static_content_update_main #439
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 [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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- run: npm ci --production | |
- name: Check for static content updates # update static content repo. | |
run: | | |
npm update odi-publishing-static-test-content --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 | |
# branch: main | |
# head_repo: ${{ secrets.ODI_GITHUB_USER }}:main | |
title: "Static content update to main branch" | |
body: | | |
Updated static content | |
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 }}" |