Release #527
Workflow file for this run
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: | |
create: | |
branches: | |
- main | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-*" | |
jobs: | |
# Build release binaries | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Set up NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Set up yarn | |
run: npm install --global yarn | |
- name: Yarn install | |
run: yarn install | |
working-directory: ui | |
- name: Build web UI | |
run: yarn build | |
working-directory: ui | |
- name: Copy web assets | |
run: | | |
cp ui/dist/* ./internal/frontend/assets/ | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{secrets.DAGU_GITHUB_TOKEN}} | |
# Build and push Docker image | |
docker: | |
needs: goreleaser | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Extract version from tag | |
id: get_version | |
run: | | |
# Remove 'v' prefix from tag | |
VERSION=${GITHUB_REF#refs/tags/v} | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:latest | |
ghcr.io/${{ github.repository }}:${{ env.VERSION }} |