Skip to content

Commit

Permalink
Docker build caching, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Jan 15, 2022
1 parent 1392335 commit de2d5b9
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -80,11 +93,16 @@ 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 }}
oc project ${{ secrets.NAMESPACE }}
# 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

0 comments on commit de2d5b9

Please sign in to comment.