Skip to content

Commit b1372af

Browse files
committed
perf: update base image
1 parent bfe7260 commit b1372af

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎.github/workflows/build-base-image.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,29 @@ on:
99
- 'package-lock.json'
1010
- 'yarn.lock'
1111
- 'Dockerfile-base'
12+
workflow_dispatch:
13+
inputs:
14+
branch:
15+
description: '构建基础镜像所用的分支'
16+
required: true
17+
type: string
18+
default: 'main'
1219

1320
jobs:
1421
build-and-push:
1522
runs-on: ubuntu-latest
1623

1724
steps:
1825
- name: Lock Pull Request
26+
if: github.event_name == 'push'
1927
run: |
2028
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
2129
-d '{"state":"pending", "description":"Action running, merge disabled", "context":"Lock PR"}' \
2230
"https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }}"
2331
- name: Checkout repository
2432
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }}
2535

2636
- name: Set up QEMU
2737
uses: docker/setup-qemu-action@v3
@@ -66,6 +76,7 @@ jobs:
6676
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6777

6878
- name: Unlock Pull Request
79+
if: github.event_name == 'push'
6980
run: |
7081
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
7182
-d '{"state":"success", "description":"Action running, merge disabled", "context":"Lock PR"}' \

0 commit comments

Comments
 (0)