diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 83cf268..ec37e87 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -57,7 +57,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # Build and push Docker image with Buildx (don't push on PR) + # Build and push Docker image with Buildx # https://github.com/docker/build-push-action - name: Build and push Docker image id: build-and-push diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eab7e8d..1b9528a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,17 +2,29 @@ name: CI on: push: - branches: [ "main" ] + branches-ignore: [ "main" ] pull_request: - branches: [ "main" ] + branches-ignore: [ "main" ] jobs: build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag shipped:$(date +%s) + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + - name: Build Docker image + id: build + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: . + push: false + cache-from: type=gha + cache-to: type=gha,mode=max