From 59c3b45067c9654afbf93a6368105c831507e340 Mon Sep 17 00:00:00 2001 From: Noah Botimer Date: Wed, 29 May 2024 14:11:49 -0400 Subject: [PATCH] Add GHA workflow to publish db-sync image --- .github/workflows/build-sync-latest.yml | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/build-sync-latest.yml diff --git a/.github/workflows/build-sync-latest.yml b/.github/workflows/build-sync-latest.yml new file mode 100644 index 0000000..c59e5bf --- /dev/null +++ b/.github/workflows/build-sync-latest.yml @@ -0,0 +1,43 @@ +--- +name: Build Lauth database sync +#description: Builds an image to synchronize databases + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@v4 + + - name: Build image and push to GitHub Container Registry + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: 'ghcr.io/mlibrary/lauth/db-sync:${{ github.sha }}, ghcr.io/mlibrary/lauth/db-sync:latest' + file: db/sync/Dockerfile + platforms: linux/amd64, linux/arm64 + + - name: Image digest + run: | + echo '${{ steps.docker_build.outputs.digest }}' +