Files
Chart.js/.github/workflows/deploy-docs.yml
Naveen 0616868959 chore: Set permissions for GitHub actions (#10399)
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-13 10:25:56 -04:00

43 lines
972 B
YAML

# This workflow publishes new documentation to https://chartjs.org/docs/master after every commit
name: Deploy docs
on:
push:
branches:
- master
permissions:
contents: read
jobs:
correct_repository:
permissions:
contents: none
runs-on: ubuntu-latest
steps:
- name: fail on fork
if: github.repository_owner != 'chartjs'
run: exit 1
build:
needs: correct_repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
cache: npm
- name: Package & Deploy Docs
run: |
npm ci
npm run build
./scripts/docs-config.sh "master"
npm run docs
npm pack
./scripts/deploy-docs.sh "master"
env:
GITHUB_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
GH_AUTH_EMAIL: ${{ secrets.GH_AUTH_EMAIL }}