name: e2e-image # Don't want to build and push this image for PRs; only pushes to master on: push: branches: [master] paths: - e2e/Dockerfile - e2e/basic.ini # Build our image caching the layers # https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: docker/setup-buildx-action@v1 - name: Cache Docker layers uses: actions/cache@v2 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('e2e/Dockerfile') }} restore-keys: | ${{ runner.os }}-buildx- ${{ runner.os }}- - uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - uses: docker/build-push-action@v2 with: context: e2e/ push: true tags: ghcr.io/${{ github.repository }}/e2e:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new # Temp fix # https://github.com/docker/build-push-action/issues/252 # https://github.com/moby/buildkit/issues/1896 - name: Move cache run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache