Skip to content

Merge pull request #112 from fachschaftinformatik/fix/regression #9

Merge pull request #112 from fachschaftinformatik/fix/regression

Merge pull request #112 from fachschaftinformatik/fix/regression #9

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Generate files
run: go generate ./...
- name: Authenticate ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/api
ghcr.io/${{ github.repository }}/website
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Prepare for buildx
uses: docker/setup-qemu-action@v3
- name: Set buildx
uses: docker/setup-buildx-action@v3
- name: Build and push API
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64
build-args: |
VERSION=${{ github.ref_name }}
tags: |
ghcr.io/${{ github.repository }}/api:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/api:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push website
uses: docker/build-push-action@v6
with:
context: .
file: website/Dockerfile
push: true
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository }}/website:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/website:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true