🎡 ci: update build config #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
pull_request: | |
push: | |
# run only against tags | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'checkout' | |
uses: actions/checkout@v4 | |
- name: 'setup pnpm' | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 8.x | |
- name: 'setup node' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
cache-dependency-path: web/pnpm-lock.yaml | |
- name: 'build frontend' | |
run: | | |
cd ./web | |
pnpm install --frozen-lockfile | |
pnpm build | |
cp -r dist ../goserver/public | |
cd .. | |
- name: fetch git tags | |
run: git fetch --force --tags | |
- name: setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.3' # The Go version to download (if necessary) and use. | |
- name: 'build and release' | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro': | |
workdir: ./goserver | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |