Add specifying Docker build concurrent jobs

Add limiting concurrent jobs in Actions
This commit is contained in:
Tindy X
2021-09-22 00:30:46 +08:00
parent 1ead1f8c7f
commit b49934635e
3 changed files with 14 additions and 5 deletions

View File

@@ -1,6 +1,10 @@
name: GitHub CI
on: [push]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
linux32_build:
name: Linux x86 Build

View File

@@ -1,6 +1,10 @@
name: Publish Docker Image
on: [push]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
@@ -30,7 +34,7 @@ jobs:
if: github.ref == 'refs/heads/master'
run: |
SHA=$(git rev-parse --short HEAD)
docker buildx build --build-arg SHA="$SHA" --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64,linux/386 --tag tindy2013/subconverter:latest scripts/
docker buildx build --build-arg SHA="$SHA" THREADS=1 --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64,linux/386 --tag tindy2013/subconverter:latest scripts/
- name: Replace tag without `v`
if: startsWith(github.ref, 'refs/tags/')