Skip to content

Commit

Permalink
Fix dev cache build in docker-cache workflow (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaeppe authored Dec 16, 2021
1 parent 2a052ee commit f67510d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:
context: .
push: true
build-args: BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/access-guard:${{ needs.source-hash.outputs.source_hash }}
tags: |
${{ env.CI_TAG }}
tags: ${{ env.CI_TAG }}

static-typing:
name: Static Typing
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/docker-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ env:
DEV_CACHE_TAG: ghcr.io/${{ github.repository_owner }}/access-guard:dev-cache

jobs:
push:
source-hash:
name: Get source hash
uses: flaeppe/access-guard/.github/workflows/source_hash.yml@master

push-base-cache:
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -38,6 +42,25 @@ jobs:
context: .
push: true
tags: ${{ env.RUNTIME_CACHE_TAG }}

push-dev-cache:
runs-on: ubuntu-latest
needs: source-hash
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
version: v0.6.3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build dev image
uses: docker/build-push-action@v2
with:
Expand All @@ -46,4 +69,5 @@ jobs:
context: .
target: dev
push: true
build-args: BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/access-guard:${{ needs.source-hash.outputs.source_hash }}
tags: ${{ env.DEV_CACHE_TAG }}

0 comments on commit f67510d

Please sign in to comment.