ci: cache docker buildx job #86
Workflow file for this run
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: Docker CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Authenticate to the Docker Hub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v3 | |
with: | |
username: steelscheme | |
password: ${{ secrets.DOCKER_HUB_PWD }} | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# disable push on merge requests | |
- name: Only Build on Pull Request | |
uses: docker/build-push-action@v6 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
push: false | |
platforms: linux/amd64,linux/arm64 | |
tags: steelscheme/steel:latest | |
cache-from: type=registry,ref=steelscheme/steel:latest | |
cache-to: type=inline | |
- name: Build and push the docker image | |
uses: docker/build-push-action@v6 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: steelscheme/steel:latest | |
cache-from: type=registry,ref=steelscheme/steel:latest | |
cache-to: type=inline |