Skip to content

chore: synced file(s) with cds-snc/site-reliability-engineering #932

chore: synced file(s) with cds-snc/site-reliability-engineering

chore: synced file(s) with cds-snc/site-reliability-engineering #932

Workflow file for this run

name: 'Deploy review app'
on:
pull_request:
types: [opened, closed, synchronize]
jobs:
review-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Install NodeJS
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: '16'
- name: Cache node modules
uses: actions/cache@940f3d7cf195ba83374c77632d1e2cbb2f24ae68 # v3.3.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Lint links
run: npm run lint-links
- name: Comment PR
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
uses: actions/github-script@f05a81df23035049204b043b50c3322045ce7eb3 # v3.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
const body = 'A review app will be deployed. Get the URL by going to https://cds-snc.github.io/notification-documentation/';
github.issues.createComment({ issue_number, owner, repo, body });
- name: Build and deploy review app
uses: sauloxd/review-apps@2564cf8a5e834c2813ace9af70dd7411f81433e4 # v2.0.0
with:
branch: "gh-pages"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
apps: |
{
"review-apps": {
"build": "npm run build",
"dist": "src/.vuepress/dist"
}
}