Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWaldorf committed Jul 30, 2024
1 parent 216d329 commit 11d3ccc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-image-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ on:
- cron: '35 2 * * *'
push:
branches: [ dev ]
pull_request:
branches: [ dev ]


# permissions are needed if pushing to ghcr.io
permissions:
permissions:
packages: write

jobs:
Expand Down Expand Up @@ -41,7 +39,9 @@ jobs:
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx


# Push to Docker Hub
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Docker Image CI
on:
# Controls when the workflow will run
push:
branches: [ main ]
tags:
- 'v*.*.*'

Expand All @@ -25,6 +24,14 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
# Key is named differently to avoid collision
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx
# Push to Docker Hub
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -54,4 +61,14 @@ jobs:
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.guac.outputs.tags }}
labels: ${{ steps.guac.outputs.labels }}
labels: ${{ steps.guac.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
# Note the mode=max here
# More: https://github.com/moby/buildkit#--export-cache-options
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

0 comments on commit 11d3ccc

Please sign in to comment.