Skip to content

Publish container image #1166

Publish container image

Publish container image #1166

Workflow file for this run

---
name: Publish container image
on:
workflow_dispatch:
release:
types:
- created
schedule:
- cron: 00 00 * * *
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up QEMU
# yamllint disable-line rule:line-length
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
- name: Set up Docker Buildx
# yamllint disable-line rule:line-length
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Login to GitHub Container Registry
# yamllint disable-line rule:line-length
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set tag for image
run: >-
echo IMAGE_TAG=$(
[ ${{ github.ref_type }} == 'tag' ]
&& echo ${{ github.ref_name }}
|| echo 'latest'
) >> $GITHUB_ENV
- name: Set up Docker Buildx
# yamllint disable-line rule:line-length
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Build and Push release
if: github.event_name != 'schedule'
# yamllint disable-line rule:line-length
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: .
build-args: |
INSTALL_ALL=true
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
ghcr.io/${{ github.repository }}:latest
# Fix multi-platform: https://github.com/docker/buildx/issues/1533
provenance: false
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
- name: Build and Push nightly
if: github.event_name == 'schedule'
# yamllint disable-line rule:line-length
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: .
build-args: |
INSTALL_ALL=true
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:nightly
# Fix multi-platform: https://github.com/docker/buildx/issues/1533
provenance: false
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"