static_content_update_staging #5023
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
name: Update static content [staging] | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [static_content_update_staging] | |
concurrency: | |
group: sync_static_content_update_staging | |
cancel-in-progress: true | |
jobs: | |
build_deploy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- run: git pull origin # jbum added | |
- run: npm ci --production | |
- name: Check for static content updates # update static content repo. | |
run: | | |
npm update static-content-cannabis-staging | |
- name: Create Pull Request # https://github.com/marketplace/actions/create-pull-request | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
committer: ${{ secrets.ODI_GITHUB_USER }} <[email protected]> | |
base: staging | |
title: "Static content update to staging branch" | |
body: | | |
Method: api.cannabis.ca.gov (WordPress REST API, Pantheon), content tagged "staging" > @cagov/cannabis-lambda-sync-github (AWS CloudFormation, arc.codes) > @cagov/static-content-cannabis-staging (Static content repo, staging branch) | |
labels: | | |
content-update-staging | |
automerge | |
commit-message: "Automated PR: Static content update [STAGING]" | |
# team-reviewers: | | |
# ${{ secrets.PR_REVIEWERS }} | |
- name: Check outputs | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | |
- name: Auto approve static content update changes # https://github.com/hmarr/auto-approve-action | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
uses: hmarr/auto-approve-action@v2 | |
with: | |
github-token: ${{ secrets.ODI_GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
- id: automerge | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
name: Auto merge static content update | |
uses: "pascalgn/[email protected]" | |
env: | |
GITHUB_TOKEN: "${{ secrets.ODI_GITHUB_TOKEN }}" |