Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/build-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,29 @@ on:
- 'package-lock.json'
- 'yarn.lock'
- 'Dockerfile-base'
workflow_dispatch:
inputs:
branch:
description: '构建基础镜像所用的分支'
required: true
type: string
default: 'main'

jobs:
build-and-push:
runs-on: ubuntu-latest

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -66,6 +76,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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