diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 234eac531..581becd34 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,6 +22,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: @@ -42,6 +53,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new deploy: name: Deploy @@ -80,7 +93,7 @@ jobs: name: dev steps: - uses: actions/checkout@v2 - - name: Cleanup + - name: Remove OpenShift artifacts run: | set -ex oc login --token=${{ secrets.OC_TOKEN }} --server=${{ secrets.OC_SERVER }} @@ -88,3 +101,8 @@ jobs: # Remove old build runs, build pods and deployment pods oc delete all -l app=gfp-${{ github.event.number }} + + - name: Remove Docker cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache