-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (55 loc) · 2.24 KB
/
static_content_update_main.yml
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
57
58
name: Update static content [main]
on:
workflow_dispatch:
repository_dispatch:
types: [static_content_update_main]
concurrency:
group: sync_static_content_update_main
cancel-in-progress: true
jobs:
build_deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.16.0
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 --production
- 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: main
title: "Static content update to main branch"
body: |
Method: api.cannabis.ca.gov (WordPress REST API, Pantheon) > @cagov/cannabis-lambda-sync-github (AWS CloudFormation, arc.codes) > @cagov/static-content-cannabis (Static content repo, main branch)
labels: |
content-update
automerge
commit-message: "Automated PR: Static content update"
# 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 }}"