Skip to content

Commit

Permalink
Add concurrency so only one deploy can run at a time. Check for linti…
Browse files Browse the repository at this point in the history
…ng failure before running the deploy on staging.
  • Loading branch information
ryanwelcher committed Feb 6, 2025
1 parent e07047b commit ab21872
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Deploy plugin to Production

concurrency: production

on:
workflow_dispatch:
workflow_run:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/deploy-to-staging.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: Deploy plugin to Staging

concurrency: staging

on:
push:
branches:
- staging

jobs:
Linting:
uses: ./.github/workflows/linting.yml
concurrency:
group: staging-deploy
cancel-in-progress: true


Deploy:
name: FTP-Deploy-Action
Expand All @@ -20,7 +19,11 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Linting
id: linting
uses: ./.github/workflows/linting.yml
- name: FTP-Deploy-Action
if: steps.linting.outcome == 'success'
uses: Automattic/[email protected]
with:
ftp-server: sftp://sftp.wp.com/htdocs/wp-content/plugins/custom-plugin/
Expand Down

0 comments on commit ab21872

Please sign in to comment.