Skip to content

Deploy to GitHub Pages #12

Deploy to GitHub Pages

Deploy to GitHub Pages #12

name: Deploy to GitHub Pages
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: cycodelabs/cimon-action@v0
with:
prevent: true
client-id: ${{ secrets.CIMON_CLIENT_ID }}
secret: ${{ secrets.CIMON_SECRET }}
allowed-hosts: |
registry.npmjs.org
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Test build
run: npm run build
release:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
pages: write
steps:
- uses: cycodelabs/cimon-action@v0
with:
prevent: true
client-id: ${{ secrets.CIMON_CLIENT_ID }}
secret: ${{ secrets.CIMON_SECRET }}
allowed-hosts: |
registry.npmjs.org
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Test build
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com