Adds concurrency documentation

This commit is contained in:
James Ives 2022-01-14 08:25:22 -05:00 committed by GitHub
parent db9290180a
commit 714df4415f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@
## Getting Started :airplane: ## Getting Started :airplane:
You can include the action in your workflow to trigger on any event that [GitHub actions supports](https://help.github.com/en/articles/events-that-trigger-workflows). If the remote branch that you wish to deploy to doesn't already exist the action will create it for you. Your workflow will also need to include the `actions/checkout` step before this workflow runs in order for the deployment to work. You can include the action in your workflow to trigger on any event that [GitHub actions supports](https://help.github.com/en/articles/events-that-trigger-workflows). If the remote branch that you wish to deploy to doesn't already exist the action will create it for you. Your workflow will also need to include the `actions/checkout` step before this workflow runs in order for the deployment to work. If you intend to make multiple deployments in quick succession [you may need to levereage the concurrency parameter in your workflow](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency) to prevent overlaps with the Git process.
You can view an example of this below. You can view an example of this below.
@ -61,6 +61,7 @@ name: Build and Deploy
on: [push] on: [push]
jobs: jobs:
build-and-deploy: build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout 🛎️ - name: Checkout 🛎️
@ -208,6 +209,7 @@ on:
- main - main
jobs: jobs:
deploy: deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout 🛎️ - name: Checkout 🛎️
@ -274,6 +276,7 @@ jobs:
path: build path: build
deploy: deploy:
concurrency: ci-${{ github.ref }}
needs: [build] # The second job must depend on the first one to complete before running, and uses ubuntu-latest instead of windows. needs: [build] # The second job must depend on the first one to complete before running, and uses ubuntu-latest instead of windows.
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -327,6 +330,7 @@ on:
- main - main
jobs: jobs:
deploy: deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout 🛎️ - name: Checkout 🛎️