-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On commit to main, auto-open PR to merge from main to staging (#210)
* Add release-process.md and update deploy workflow to run on all versioned tags. Also, remove value-created-log.md. * Run deploy workflow on push to main or staging branches. * Add workflow to open a PR on commit to main. (Includes organize-workflows branch for debugging w/o excessive merging) * Update release-process.md with PR workflow * Move PR creation workflow to shared workflow * Check out repo as first step in pr creation * Add missing trailing backslash * remove automerge label * Quote debugging * Remove debug feature branch trigger
- Loading branch information
1 parent
e5a01c5
commit 74dffac
Showing
6 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Create pull request to branch | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
head: | ||
type: string | ||
default: ${{ github.ref_name }} | ||
base: | ||
required: true | ||
type: string | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
HEAD: ${{ inputs.head }} | ||
BASE: ${{ inputs.base }} | ||
|
||
jobs: | ||
create-pr: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
pr_number: ${{ steps.pr-number.outputs.pull_request_number }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for existing PR | ||
id: check-pr | ||
run: | | ||
PR=$(gh pr list --base ${BASE} --head ${HEAD} --json number --jq '.[0].number') | ||
echo "::set-output name=pr_exists::$PR" | ||
- name: Create pull request | ||
if: steps.check-pr.outputs.pr_exists == '' | ||
run: | | ||
gh pr create \ | ||
--label "autogenerated" \ | ||
--base ${BASE} --head ${HEAD} \ | ||
--title "Deploy to ${BASE}" \ | ||
--body "Automated PR to sync changes from ${HEAD} to ${BASE}." | ||
- name: Get pull request number | ||
id: pr-number | ||
run: echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Create PR from main to staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
create-pr-to-staging: | ||
uses: ./.github/workflows/_create-pr-to-branch.yml | ||
secrets: inherit | ||
with: | ||
base: staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Release process | ||
|
||
There are currently two environments: | ||
|
||
- `main` (dev, main branch, CI/CD) | ||
- `staging` (manually deployed via a release tag) | ||
|
||
## Overview | ||
|
||
To promote continuous integration, the 10x Forms Platform uses trunk-based development. In trunk-based development, we collaborate on code in a single, mainline branch. | ||
|
||
Deployments are managed by Terraform CDK. On merge to main, the [../.github/workflows/deploy.yml](../.github/workflows/deploy.yml) Github Action workflow builds Docker images for each app in the repository, pushes them to [ghcr.io](https://github.com/orgs/GSA-TTS/packages?repo_name=atj-platform), and deploys to the dev environment (`gsa-tts-10x-atj-dev`). | ||
|
||
When commits are made to main, the [../.github/workflows/create-pr-to-staging.yml](../.github/workflows/create-pr-to-staging.yml) workflow creates a PR to deploy to the staging environment, if it doesn't already exist. |
This file was deleted.
Oops, something went wrong.