Skip to content

Commit

Permalink
Merge pull request #36 from liam-hp/qa
Browse files Browse the repository at this point in the history
chore(auto-promote): qa to prod
  • Loading branch information
liam-hp committed Aug 28, 2023
2 parents 5f60cf6 + d0eddf4 commit add8bf5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/cicd-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
with:
FETCH_FROM: dev

fetch-build-main:
if: github.ref == 'refs/heads/main'
fetch-build-prod:
if: github.ref == 'refs/heads/prod'
uses: ./.github/workflows/fetch-build.yaml
with:
FETCH_FROM: qa
Expand All @@ -56,9 +56,9 @@ jobs:
needs: fetch-build-qa
uses: ./.github/workflows/release.yaml

release-main:
if: github.ref == 'refs/heads/main'
needs: fetch-build-main
release-prod:
if: github.ref == 'refs/heads/prod'
needs: fetch-build-prod
uses: ./.github/workflows/release.yaml

inject-deploy-dev:
Expand All @@ -79,10 +79,10 @@ jobs:
S3_BUCKET: s3://build-once-deploy-many-${{ github.ref_name }}
secrets: inherit

inject-deploy-main:
if: github.ref == 'refs/heads/main' && ${{ needs.release-internal.outputs.deploy }}
inject-deploy-prod:
if: github.ref == 'refs/heads/prod' && ${{ needs.release-internal.outputs.deploy }}
uses: ./.github/workflows/deploy.yaml
needs: release-main
needs: release-prod
with:
DEPLOY_ENV: ${{ github.ref_name }}
S3_BUCKET: s3://build-once-deploy-many-${{ github.ref_name }}
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/sync-branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Promote qa to main
- name: Promote qa to prod
uses: repo-sync/pull-request@v2
with:
source_branch: qa
destination_branch: main
destination_branch: prod
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "chore(auto-promote): qa to main"
pr_body: ":arrow_up: *An automated PR to promote from qa to main branch*"
pr_title: "chore(auto-promote): qa to prod"
pr_body: ":arrow_up: *An automated PR to promote from qa to prod branch*"
pr_label: autopromote

sync-pr-main:
if: github.ref == 'main' && github.event.pull_request.merged == true
sync-pr-prod:
if: github.ref == 'prod' && github.event.pull_request.merged == true
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Sync main to dev
- name: Sync prod to dev
uses: repo-sync/pull-request@v2
with:
source_branch: main
source_branch: prod
destination_branch: dev
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "chore(auto-sync): main to dev"
pr_body: ":arrow_up: *An automated PR to sync from main to dev branch*"
pr_title: "chore(auto-sync): prod to dev"
pr_body: ":arrow_up: *An automated PR to sync from prod to dev branch*"
pr_label: autopromote

2 changes: 1 addition & 1 deletion release.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
branches: [{ name: 'main' }, { name: 'qa', prerelease: true }, { name: 'dev', prerelease: true }],
branches: [{ name: 'prod' }, { name: 'qa', prerelease: true }, { name: 'dev', prerelease: true }],
plugins: [
[
'@semantic-release/github',
Expand Down

0 comments on commit add8bf5

Please sign in to comment.