generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 40
56 lines (45 loc) · 2.14 KB
/
prepare_deployment_branch.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: "Prepare Deployment Branch"
on:
workflow_dispatch:
schedule:
# 3:00am UTC Tuesdays and Thursdays // 10:00pm EST Mondays and Wednesdays // 7:00pm PST Mondays and Wednesdays (https://crontab.guru/#0_3_*_*_2,4)
# GitHub actions run in UTC (and EDT is UTC-4)
# If this schedule changes, check any reminders that might be in slack with `/remind list`
- cron: "0 3 * * 2,4"
jobs:
prepare_branch:
name: "Prepare the deployment branch and file a PR"
runs-on: ubuntu-latest
steps:
- name: "Check out changes"
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- name: Set Environment Variables
run: |
DEPLOYMENT_DATE=$(date +%Y-%m-%d)
echo >> ${GITHUB_ENV} DEPLOYMENT_DATE=${DEPLOYMENT_DATE?}
echo >> ${GITHUB_ENV} BRANCH_NAME=deployment/${DEPLOYMENT_DATE?}
- name: Output Branch Name
run: |
echo "Branch name: \"${BRANCH_NAME}\""
- name: "Create branch '${{ env.BRANCH_NAME }}' to contain the changes for the deployment on ${{ env.DEPLOYMENT_DATE }}"
uses: JosiahSiegel/remote-branch-action@dbe7a2138eb064fbfdb980abee918091a7501fbe
## DevSecOps - Aquia (Replace) - uses: ./.github/actions/remote-branch-action
with:
branch: "${{ env.BRANCH_NAME }}"
- name: "Prepare a Pull Request from ${{ env.BRANCH_NAME }} into production branch"
id: pr
uses: JosiahSiegel/reliable-pull-request-action@ae8d0c88126329ee363a35392793d0bc94cb82e7
## DevSecOps - Aquia (Replace) - uses: ./.github/actions/reliable-pull-request-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "Deployment of ${{ env.DEPLOYMENT_DATE }}"
sourceBranch: "${{ env.BRANCH_NAME }}"
targetBranch: "production"
labels: DevOps,chore,deployment
body: |
## Deployment of ${{ env.DEPLOYMENT_DATE }}
This PR contains the changes that will go into the deployment scheduled for ${{ env.DEPLOYMENT_DATE }}.
- name: "Produce Pull Request URL"
run: |
echo "PR URL: ${{ steps.pr.outputs.PRURL }}"