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 +