From fcc571f30761c8e4c3a5b0597253a60194333b13 Mon Sep 17 00:00:00 2001 From: Cullen Taylor Date: Mon, 15 Jun 2026 15:10:33 -0400 Subject: [PATCH] ci: add workflow to publish atryum image to Docker Hub Add a GitHub Actions workflow that builds the production atryum image from Dockerfile.prod and pushes it to Docker Hub under validmind/atryum. - Builds multi-arch images (linux/amd64, linux/arm64) via QEMU + Buildx - Derives tags with docker/metadata-action: latest and sha on main, semver tags on v* releases, and a custom tag on manual dispatch - Authenticates with DOCKERHUB_USERNAME / DOCKERHUB_TOKEN secrets - Uses GitHub Actions cache to speed up rebuilds The org gha-workflows reusable build/push workflows target AWS ECR only, so a standalone workflow is used for the Docker Hub destination. --- .github/workflows/docker-publish.yml | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..a697f56 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,65 @@ +name: Publish Docker image + +on: + push: + branches: [main] + tags: ["v*"] + workflow_dispatch: + inputs: + tag: + description: "Image tag to push (defaults to 'latest')" + required: false + default: latest + +permissions: + contents: read + +concurrency: + group: docker-publish-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-push: + name: Build and push to Docker Hub + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: validmind/atryum + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile.prod + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max