Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Hub builds #510

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ on:
push:
branches: [ "main" ]
workflow_dispatch: # Handy for testing
inputs:
VERSION:
description: 'Version number to tag the image with'
default: latest
required: true
PUSH:
description: 'Whether to push the image to the registry'
default: false
required: true

jobs:
build-quesma-docker-image:
Expand All @@ -31,15 +40,30 @@ jobs:
username: _json_key
password: ${{ secrets.GCR_SERVICE_ACCOUNT_PRIVATE_KEY }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PAT }}

- name: Set the build date
run: echo QUESMA_BUILD_DATE=$(git --no-pager log -1 --date=format:'%Y-%m-%d' --format="%ad") >> $GITHUB_ENV

- name: Build and export
uses: docker/build-push-action@v6
with:
context: ${{ matrix.module }}/.
tags: europe-docker.pkg.dev/metal-figure-407109/quesma-nightly/quesma:${{ github.sha }}
# Pushes to GCR only for `main` branch builds
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: |
europe-docker.pkg.dev/metal-figure-407109/quesma-nightly/quesma:${{ github.sha }}
europe-docker.pkg.dev/metal-figure-407109/quesma-nightly/quesma:${{ github.event.inputs.VERSION }}
quesma/quesma:${{ github.event.inputs.VERSION }}
quesma/quesma:latest
# Pushes to GCR only for `main` branch builds, unless set explicitly in the job input
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event.inputs.PUSH }}
build-args: |
QUESMA_BUILD_SHA=${{ github.sha }}
QUESMA_VERSION=${{ github.event.inputs.VERSION }}
QUESMA_BUILD_DATE=${{ env.QUESMA_BUILD_DATE }}
platforms: linux/amd64,linux/arm64
env:
DOCKER_BUILD_SUMMARY: false
Loading