generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
35 lines (33 loc) · 1.02 KB
/
publish-gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Publish GitHub Pages
on:
workflow_call:
inputs:
destination_dir:
required: true
type: string
jobs:
publish-to-gh-pages:
name: Publish to GitHub Pages
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Ensure `destination_dir` is not empty
if: ${{ inputs.destination_dir == '' }}
run: exit 1
- name: Checkout the repository
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install npm dependencies
run: yarn --immutable
- name: Run build script
run: yarn build:prod
- name: Deploy to `${{ inputs.destination_dir }}` directory of `gh-pages` branch
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
with:
personal_token: ${{ secrets.DEPLOY_TOKEN }}
publish_dir: ./dist
destination_dir: ${{ inputs.destination_dir }}