Skip to content

ci: cache docker buildx job #91

ci: cache docker buildx job

ci: cache docker buildx job #91

Workflow file for this run

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: Build docker image (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=gha
# # cache-to: type=gha,mode=max
# cache-from: type=registry,ref=steelscheme/steel:buildcache
# cache-to: type=registry,ref=steelscheme/steel:buildcache,mode=max
- name: Build & publish 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=gha
cache-to: type=gha,mode=max
cache-from: type=registry,ref=steelscheme/steel:buildcache

Check failure on line 51 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / Docker CI

Invalid workflow file

The workflow is not valid. .github/workflows/docker.yml (Line: 51, Col: 11): 'cache-from' is already defined .github/workflows/docker.yml (Line: 52, Col: 11): 'cache-to' is already defined
cache-to: type=registry,ref=steelscheme/steel:buildcache,mode=max