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@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - name: Set up QEMU uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0 - name: Login to GitHub Container Registry uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.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 uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0 - name: Build and Push release if: github.event_name != 'schedule' uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.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' uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.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 }}"