Build Docker #52
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: Build Docker | |
on: | |
schedule: | |
- cron: "44 4 * * *" | |
workflow_dispatch: | |
inputs: | |
branch: | |
required: true | |
type: string | |
default: main | |
description: branch or tag to checkout when building | |
env: | |
REPO: ghcr.io/hydradatabase/pg_duckdb | |
BRANCH: ${{ inputs.branch || 'main' }} | |
jobs: | |
docker: | |
name: Build Docker | |
runs-on: ubuntu-24.04 | |
strategy: | |
# fail-fast: false | |
matrix: | |
postgres: ["15", "16", "17"] | |
platform: ["linux/amd64", "linux/arm64"] | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Checkout Docker files | |
uses: actions/checkout@v4 | |
- name: Set env | |
run: | | |
echo "POSTGRES_VERSION=${{ matrix.postgres }}" >> $GITHUB_ENV | |
echo "TAG=${{ env.REPO }}:${{ matrix.postgres }}-${{ env.BRANCH }}" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: ${{ matrix.platform }} | |
- name: docker bake | |
uses: docker/bake-action@v5 | |
with: | |
targets: pg_duckdb_${{ matrix.postgres }} | |
push: true | |
set: | | |
*.platform=${{ matrix.platform }} | |
*.cache-to=type=gha,mode=max | |
*.cache-from=type=gha | |
postgres.tags=${{ env.TAG }} |