Skip to content

add permissions to gh action job #5

add permissions to gh action job

add permissions to gh action job #5

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
defaults:
run:
working-directory: arml-website
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
DOCUSAURUS_URL: https://fubilab.github.io
DOCUSAURUS_BASE_URL: /arml/
runs-on: ubuntu-latest
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
# 👇 Build steps
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
cache-dependency-path: arml-website/yarn.lock
- name: Install dependencies
working-directory: arml-website
run: yarn install --frozen-lockfile --non-interactive
- name: Build
working-directory: arml-website
run: yarn build
# 👆 Build steps
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# 👇 Specify build output path
path: arml-website/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2