diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0bcb77ab..3a5f2edd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,12 +35,19 @@ jobs: containerise: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - name: Log into GitHub Container Registry run: echo "${{ secrets.REGISTRY_ACCESS_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin - - name: Build the container image - run: | - LATEST_TAG=ghcr.io/meeb/$IMAGE_NAME:latest - docker buildx create --name builder - docker buildx use builder - docker buildx build --platform linux/amd64 --tag $IMAGE_NAME --push . + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + push: true + tags: ghcr.io/meeb/$IMAGE_NAME:latest + cache-from: type=registry,ref=ghcr.io/meeb/$IMAGE_NAME:latest + cache-to: type=inline