Skip to content

Chore: Leverage Cache to Speed Up Docker Deployment #42

Chore: Leverage Cache to Speed Up Docker Deployment

Chore: Leverage Cache to Speed Up Docker Deployment #42

Workflow file for this run

name: ci
on:
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
run-tests:
name: Run Automated Tests
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Current Commit
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: ./.output/tmp/.buildx-cache
key: ${{ runner.os }}-buildx
- name: Build All Docker Images Necessary For Tests
run: |
docker buildx bake \
-f ./deploy/local/tests/docker-bake.json \
--set '*.cache-from'="type=local,src=./.output/tmp/.buildx-cache" \
--set '*.cache-to'="type=local,dest=./.output/tmp/.buildx-cache-new" \
--load
- name: Run Automated Tests
run: make test
# This ugly bit is necessary if you don't want your cache to grow forever
# until it hits GitHub's limit of 5GB.
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf ./.output/tmp/.buildx-cache
mv ./.output/tmp/.buildx-cache-new ./.output/tmp/.buildx-cache
- name: Notify To Slack If Failed
uses: lazy-actions/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: "*[hex-monscape]* ${{ github.job }}"
mention: "here"
mention_if: "failure"
channel: "#solutions-team-ci-cd"
icon_emoji: ":haraaj:"
username: "ci/cd-reporter"
url: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}