|
| 1 | +name:documentation |
| 2 | + |
| 3 | +on: |
| 4 | +pull_request: |
| 5 | +branches:[documentation] |
| 6 | +push: |
| 7 | +branches:[documentation] |
| 8 | + |
| 9 | +jobs: |
| 10 | +checks: |
| 11 | +if:github.event_name != 'push' |
| 12 | +runs-on:ubuntu-latest |
| 13 | +steps: |
| 14 | + -uses:actions/checkout@v1 |
| 15 | + -uses:actions/setup-node@v1 |
| 16 | +with: |
| 17 | +node-version:'12.x' |
| 18 | +run:| |
| 19 | + npm ci |
| 20 | + npm run build |
| 21 | +gh-release: |
| 22 | +if:github.event_name != 'pull_request' |
| 23 | +runs-on:ubuntu-latest |
| 24 | +steps: |
| 25 | + -uses:actions/checkout@v1 |
| 26 | + -uses:actions/setup-node@v1 |
| 27 | +with: |
| 28 | +node-version:'12.x' |
| 29 | + -name:Add key to allow access to repository |
| 30 | +env: |
| 31 | +SSH_AUTH_SOCK:/tmp/ssh_agent.sock |
| 32 | +run:| |
| 33 | + mkdir -p ~/.ssh |
| 34 | + ssh-keyscan github.com >> ~/.ssh/known_hosts |
| 35 | + echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa |
| 36 | + chmod 600 ~/.ssh/id_rsa |
| 37 | + cat <<EOT >> ~/.ssh/config |
| 38 | + Host github.com |
| 39 | + HostName github.com |
| 40 | + IdentityFile ~/.ssh/id_rsa |
| 41 | + EOT |
| 42 | + -name:Release to GitHub Pages |
| 43 | +env: |
| 44 | +USE_SSH:true |
| 45 | +GIT_USER:git |
| 46 | +run:| |
| 47 | + git config --global user.email "actions@github.com" |
| 48 | + git config --global user.name "gh-actions" |
| 49 | + npm ci |
| 50 | + npx docusaurus deploy |