Skip to content

Update text to be correct for start of 2024 #25

Update text to be correct for start of 2024

Update text to be correct for start of 2024 #25

name: Netlify MkDocs Previews
on:
pull_request_target:
paths:
- "docs/**"
jobs:
deploy-preview:
# If the PR is coming from a branch in this repo, allow it to run. If it's
# from a fork, then require the "deploy-preview" label to exist
# https://git.io/JsVv1
if: "!github.event.repository.fork || (github.event.repository.fork && contains(github.event.pull_request.labels.*.name, 'deploy-preview'))"
name: Deploy Netlify Preview
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Build MkDocs website
run: |
pip install -r docs/requirements.txt
mkdocs build
- name: Install Netlify CLI
run: npm install -g netlify-cli
# Don't expose secrets to any other process other than the `netlify` cli;
# don't risk rogue dependencies pulling our secrets
- name: Deploy Preview to Netlify
run: |
netlify deploy \
--dir="site" \
--alias="${GITHUB_REPOSITORY#*/}-${{ github.event.number }}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_PREVIEW_APP_SITE_ID }}
- name: Add Netlify link PR comment
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const hostnameSuffix = "cal-itp-previews.netlify.app"
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Preview url: https://${context.repo.repo}-${{ github.event.number }}--${hostnameSuffix}`,
})