-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VACMS-16476: production tag workflow #336
Conversation
@@ -0,0 +1,128 @@ | |||
name: Create Production Tag | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This based on the Content Build Daily production release (tag), with some (IMHO) improvements and changes.
https://github.com/department-of-veterans-affairs/content-build/actions/runs/7506884417/workflow
@@ -0,0 +1,128 @@ | |||
name: Create Production Tag | |||
|
|||
on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This intention here is that 2 things will trigger a new production tag:
- manual tagging (this is a backup)
- a completed successful run of the CI workflow on the main branch
This is to get away from daily timed tagging and enable more continual deployment with tests in place to ensure application integrity.
name: Create Production Tag | ||
runs-on: ubuntu-latest | ||
# Run the workflow unless it was triggered by CI and that failed | ||
if: ${{ !(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot prevent a failed but completed CI run from triggering the workflow, so we have this here to prevent the tagging from running if it was a failure.
id: get-latest-tag | ||
run: echo LATEST_TAG_VERSION=$(git fetch --all --tags > /dev/null && git tag -l | sort -V --reverse | head -n 1) >> $GITHUB_OUTPUT | ||
|
||
- name: Get next tag version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was reworked some from the Content Build version, which assumes the numbering scheme will always be v0.0.123
or some other number on the end. The rework expects a semver-type version (3 numbers separated by .
but otherwise makes no assumptions about the incoming tag structure.
It will output the same tag structure with the point version incremented by 1.
Description
Relates to department-of-veterans-affairs/va.gov-cms#16476
Testing done
This was tested by running the workflow against the Next Build repo to generate tags. There were a number of both unsuccessful and successful runs, all of which can be seen here: https://github.com/department-of-veterans-affairs/next-build/actions/workflows/production-tag.yml
The resulting tags are here: https://github.com/department-of-veterans-affairs/next-build/tags
Every tag after the first one was created by this workflow.
Both success and failure are being reported into this Slack channel: https://dsva.slack.com/archives/C06DSBT7CBW
Screenshots
QA steps
There is not a good way to test this without enabling the workflow for Pull Request events; this is how the testing/development was done in the first place. I would recommend reviewing the workflow runs to see how the workflow played out.
There are also explanatory comments on the file itself.
Tasks
Is this PR blocked by another PR?
DO NOT MERGE
label