Skip to content

Commit 53226a9

Browse files
committed
feat: add concurrency control to workflows
1 parent 61c0c8b commit 53226a9

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.github/workflows/build-and-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ permissions:
1414
issues: write
1515
pull-requests: write
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
build:
1923
runs-on: ubuntu-latest
@@ -78,8 +82,6 @@ jobs:
7882
# Build and push all variants
7983
make push VERSION="$VERSION" REGISTRY="ghcr.io/${{ github.repository_owner }}"
8084
shell: bash
81-
- name: Log in to GHCR
82-
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u skunxicat --password-stdin
8385
- name: Create release
8486
if: env.SHOULD_RELEASE == 'true'
8587
run: npx semantic-release

.github/workflows/build-base.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
- 'runtime/**'
1616
- 'task/handler.sh'
1717

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
1822
jobs:
1923
build-base:
2024
runs-on: ubuntu-latest
@@ -33,6 +37,13 @@ jobs:
3337

3438
- name: Build and push base
3539
run: |
36-
./build --platform linux/arm64 --tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime --push base
40+
docker buildx build \
41+
--platform linux/arm64 \
42+
--provenance=false \
43+
--secret id=github_token,env=GITHUB_TOKEN \
44+
--target base \
45+
--tag ghcr.io/${{ github.repository_owner }}/lambda-shell-runtime:base \
46+
--push \
47+
.
3748
env:
3849
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-installers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
paths:
1212
- 'Dockerfile'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
build-installers:
1620
runs-on: ubuntu-latest

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ for VARIANT in $VARIANTS; do
4141
DOCKERFILE="./Dockerfile"
4242
TARGET="$VARIANT"
4343

44-
[ "$VARIANT" = "base" ] && TARGET=""
44+
[ "$VARIANT" = "base" ] && TARGET="base"
4545

4646
echo "Building $VARIANT ($DOCKERFILE) with platform $PLATFORM..."
4747

0 commit comments

Comments
 (0)