feat: add initial Dockerfile #1
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: Build and release | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: # Run release builds sequentially, cancel outdated PR builds | |
group: ci-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: # Grant write access to github.token within non-pull_request builds | |
contents: write | |
id-token: write | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- id: release | |
name: Prepare release | |
uses: mgoltzsche/conventional-release@v0 | |
- name: Set up qemu | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Build | |
if: '!steps.release.outputs.publish' # run only if not release build | |
run: | | |
make build-release | |
- name: Log into GitHub Container Registry | |
if: steps.release.outputs.publish | |
run: echo "${{ github.token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Publish release | |
if: steps.release.outputs.publish # run only if release build | |
run: | | |
make release VERSION=$RELEASE_VERSION | |