Version Packages #530
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: Netlify | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
Deploy: | |
runs-on: ubuntu-latest | |
env: | |
NETLIFY_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- uses: nelonoel/branch-name@v1.0.1 | |
- run: npx typedoc | |
- name: Docsify variables | |
env: | |
DOMAIN: ${{ env.BRANCH_NAME == 'master' && 'forms.hypermedia.app' || format('{0}--shaperone.netlify.app', env.BRANCH_NAME) }} | |
run: npx json -I -f dist/variables.json -e "this.playground='https://$DOMAIN/playground'" | |
- name: Publish preview | |
uses: jsmrcaga/action-netlify-deploy@v2.1.0 | |
if: env.NETLIFY_TOKEN | |
with: | |
NETLIFY_AUTH_TOKEN: ${{ env.NETLIFY_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_DEPLOY_MESSAGE: Preview ${{ env.BRANCH_NAME }} | |
build_directory: dist | |
deploy_alias: ${{ env.BRANCH_NAME }} | |
NETLIFY_DEPLOY_TO_PROD: ${{ env.BRANCH_NAME == 'master' }} | |
monorepo_package: "@hydrofoil/shaperone-playground" | |
- uses: exercism/pr-commenter-action@v1.4.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
template-variables: | | |
{ | |
"url": "${{ env.NETLIFY_PREVIEW_URL }}" | |
} |