docker #58
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: docker | |
on: | |
schedule: | |
- cron: '30 18 * * *' | |
env: | |
CERBERUS_IMAGE_ID: ghcr.io/rems-project/cerberus/cn:release | |
# Cancelling an in-progress job when a new push is performed causes the CI to | |
# show up as failed: https://github.com/orgs/community/discussions/8336 | |
# This is noisy. If we want to enable that, we should consider: | |
# https://github.com/MercuryTechnologies/delete-cancelled-runs | |
concurrency: | |
group: docker-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
deploy-docker: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [linux/amd64, linux/arm64] | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build the Docker image | |
run: | | |
echo "Building ${{env.CERBERUS_IMAGE_ID}}" | |
PLATFORM=${{ matrix.platform }} make -f Makefile_docker release_cn | |
docker tag cn:release ${{env.CERBERUS_IMAGE_ID}} | |
- name: Push the Docker image | |
run: docker push ${{env.CERBERUS_IMAGE_ID}} |