From 5e2a54a886a8f5eea2ff8b31ffdde30f26406013 Mon Sep 17 00:00:00 2001 From: Coleman McFarland Date: Fri, 6 Jun 2025 21:03:16 -0400 Subject: [PATCH] Add GHA workflow to build and push docker container Still need to add secrets to the Repo's backend to make the push work. --- .github/workflows/build-docker.yml | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 00000000..be503a7f --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,40 @@ +name: Build Docker Container + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Login to Quay.io + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.REGISTRY_RW_USERNAME }} + password: ${{ secrets.REGISTRY_RW_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + # Only PUSH if it's a commit to main + push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + tags: quay.io/chroot.club/raku-examples:latest + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + quay_expiration=8w +