Skip to content

Build Container

Build Container #8

Workflow file for this run

name: Build Container
on:
release:
types: [created]
workflow_dispatch:
env:
REGISTRY: ghcr.io
GITHUB_REPO: ${{ github.repository }}
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.GITHUB_REPO }}
tags: |
type=raw,value=latest
type=raw,value=stable,enable=${{ github.event_name == 'release' }}
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
type=sha,priority=250,enable=${{ github.event_name == 'workflow_dispatch' }}
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
github_token=${{ secrets.GITHUB_TOKEN }}
sentry_token=${{ secrets.SENTRY_TOKEN }}
build_link=https://github.com/${{ env.GITHUB_REPO }}/tree/${{ github.sha }}
build_name=${{ steps.vars.outputs.sha_short }}