Skip to content

Merge pull request #12 from railwayapp/jr/pro-3709-automatic-releases… #1

Merge pull request #12 from railwayapp/jr/pro-3709-automatic-releases…

Merge pull request #12 from railwayapp/jr/pro-3709-automatic-releases… #1

Workflow file for this run

name: Release with GoReleaser
on:
push:
tags:
- "v*"
permissions:
contents: write # needed to create releases
packages: write # needed if you're publishing to GitHub Packages
jobs:
build-and-push-frontend:
name: Build and push frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3.3.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Log into registry
uses: docker/login-action@v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: ghcr.io/${{ github.repository }}-frontend
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build Docker image
id: build
uses: docker/build-push-action@v5.3.0
with:
context: .
file: frontend.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: |
type=gha
type=registry,ref=ghcr.io/${{ github.repository }}-frontend:buildcache
cache-to: |
type=gha,mode=max
type=registry,ref=ghcr.io/${{ github.repository }}-frontend:buildcache,mode=max
release:
# needs: build-and-push-frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for changelog generation
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.4"
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}