Skip to content

Commit 31d3e63

Browse files
committed
ci: use gha cache and fix release-please triggers
1 parent 87f1aeb commit 31d3e63

2 files changed

Lines changed: 20 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -126,26 +126,24 @@ jobs:
126126
- ruby
127127
- openapi
128128
- frontend
129+
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'release-please--')
129130
runs-on: ubuntu-latest
130131
steps:
131132
- uses: actions/checkout@v6
132-
133+
- uses: docker/setup-buildx-action@v4
133134
- name: Build Docker smoke image
134-
run: docker build -t html2rss/web -f Dockerfile .
135-
136-
- name: Export Docker smoke image
137-
run: docker save html2rss/web -o /tmp/html2rss-web-smoke-image.tar
138-
139-
- name: Upload Docker smoke image
140-
uses: actions/upload-artifact@v7
135+
uses: docker/build-push-action@v7
141136
with:
142-
name: docker-smoke-image
143-
path: /tmp/html2rss-web-smoke-image.tar
144-
retention-days: 1
137+
context: .
138+
load: true
139+
tags: html2rss/web
140+
cache-from: type=gha
141+
cache-to: type=gha,mode=max
145142

146143
docker-test:
147144
needs:
148145
- docker-build-smoke-image
146+
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'release-please--')
149147
runs-on: ubuntu-latest
150148
strategy:
151149
fail-fast: false
@@ -158,14 +156,16 @@ jobs:
158156
with:
159157
bundler-cache: true
160158

161-
- name: Download Docker smoke image
162-
uses: actions/download-artifact@v8
163-
with:
164-
name: docker-smoke-image
165-
path: /tmp
159+
- uses: docker/setup-buildx-action@v4
166160

167-
- name: Load Docker smoke image
168-
run: docker load -i /tmp/html2rss-web-smoke-image.tar
161+
- name: Build Docker smoke image
162+
uses: docker/build-push-action@v7
163+
with:
164+
context: .
165+
load: true
166+
tags: html2rss/web
167+
cache-from: type=gha
168+
cache-to: type=gha,mode=max
169169

170170
- name: Run Docker smoke test
171171
env:

.github/workflows/release.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,6 @@ jobs:
154154
username: ${{ secrets.DOCKER_USERNAME }}
155155
password: ${{ secrets.DOCKER_PASSWORD }}
156156

157-
- name: Cache Docker layers
158-
uses: actions/cache@v4
159-
with:
160-
path: /tmp/.buildx-cache
161-
key: ${{ runner.os }}-buildx-${{ github.sha }}
162-
restore-keys: |
163-
${{ runner.os }}-buildx-
164-
165157
- name: Build and push Docker image
166158
uses: docker/build-push-action@v7
167159
env:
@@ -174,8 +166,8 @@ jobs:
174166
BUILD_TAG=${{ env.RELEASE_VERSION }}
175167
GIT_SHA=${{ needs.guard.outputs.target_sha }}
176168
platforms: linux/amd64,linux/arm64
177-
cache-from: type=local,src=/tmp/.buildx-cache
178-
cache-to: type=local,dest=/tmp/.buildx-cache-new
169+
cache-from: type=gha
170+
cache-to: type=gha,mode=max
179171
provenance: true
180172
sbom: true
181173
labels: |
@@ -188,11 +180,6 @@ jobs:
188180
org.opencontainers.image.url=https://github.com/${{ github.repository }}/releases/tag/${{ env.RELEASE_TAG }}
189181
org.opencontainers.image.version=${{ env.RELEASE_VERSION }}
190182
191-
- name: Move updated cache into place
192-
run: |
193-
rm -rf /tmp/.buildx-cache
194-
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
195-
196183
- name: Summarize published image tags
197184
run: |
198185
{

0 commit comments

Comments
 (0)