Skip to content

Commit 651ccf5

Browse files
committed
chore: optimize CI and release workflows with caching and workflow_run trigger
1 parent 6857a14 commit 651ccf5

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ jobs:
2626
node-version-file: .nvmrc
2727
cache: pnpm
2828

29+
# Otherwise, error: ERROR: failed to build: Cache export is not supported
30+
# for the docker driver. Switch to a different driver, or turn on the
31+
# containerd image store, and try again. Learn more at
32+
# https://docs.docker.com/go/build-cache-backends/
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v4
35+
2936
- name: Build and run Dev Container task
3037
uses: devcontainers/ci@v0.3
3138
with:
@@ -34,6 +41,8 @@ jobs:
3441
# (https://www.gnu.org/software/coreutils/manual/html_node/true-invocation.html)
3542
runCmd: true
3643
push: never
44+
cacheFrom: type=gha
45+
cacheTo: type=gha,mode=max
3746

3847
- name: Install dependencies
3948
run: pnpm install

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Release
22

33
on:
4-
push:
4+
workflow_run:
5+
workflows: [CI]
6+
types:
7+
- completed
58
branches:
69
- main
7-
paths-ignore:
8-
- "docs/**"
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
@@ -36,6 +37,9 @@ jobs:
3637
node-version-file: .nvmrc
3738
cache: pnpm
3839

40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v4
42+
3943
- name: Build and run Dev Container task
4044
uses: devcontainers/ci@v0.3
4145
with:
@@ -44,6 +48,8 @@ jobs:
4448
# (https://www.gnu.org/software/coreutils/manual/html_node/true-invocation.html)
4549
runCmd: true
4650
push: never
51+
cacheFrom: type=gha
52+
cacheTo: type=gha,mode=max
4753

4854
- name: Install dependencies
4955
run: pnpm install

0 commit comments

Comments
 (0)