add docker build cache #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build demoapp-backend | |
# Events: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows | |
on: | |
push: | |
branches: | |
- main | |
- release/.* | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
jobs: | |
lint: | |
uses: ./.github/workflows/lint.yml # Workflow calls need to be executed as jobs | |
with: | |
yaml: true | |
build: | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build container image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Containerfile | |
push: false | |
tags: demoapp-backend | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |