mirror of
https://github.com/pommee/goaway.git
synced 2026-05-17 23:08:33 -05:00
73 lines
2.0 KiB
YAML
73 lines
2.0 KiB
YAML
name: Build & Deploy GoAway release and Docker image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- ".github/workflows/docs.yml"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install conventionalcommits
|
|
run: npm install conventional-changelog-conventionalcommits -D
|
|
|
|
- name: Semantic Release
|
|
uses: cycjimmy/semantic-release-action@v4
|
|
id: semantic
|
|
with:
|
|
extra_plugins: |
|
|
@semantic-release/git
|
|
@semantic-release/exec
|
|
@semantic-release/changelog
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Set up Node.js
|
|
if: steps.semantic.outputs.new_release_published == 'true'
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
|
|
- name: Install pnpm
|
|
if: steps.semantic.outputs.new_release_published == 'true'
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
|
|
- name: Build website
|
|
if: steps.semantic.outputs.new_release_published == 'true'
|
|
run: make build
|
|
|
|
- name: Remove dirty git state (according to goreleaser)
|
|
if: steps.semantic.outputs.new_release_published == 'true'
|
|
run: rm package-lock.json package.json
|
|
|
|
- name: Run GoReleaser
|
|
if: steps.semantic.outputs.new_release_published == 'true'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
run: |
|
|
curl -sL https://git.io/goreleaser | bash
|
|
|
|
- name: Log in to DockerHub
|
|
if: success() && steps.semantic.outputs.new_release_published == 'true'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push Docker image
|
|
if: success() && steps.semantic.outputs.new_release_published == 'true'
|
|
run: |
|
|
make publish
|