From 41d9ec4025b79a5d243eaf5743e42c8147830a4d Mon Sep 17 00:00:00 2001 From: Jonathan Ho <48591478+H01001000@users.noreply.github.com> Date: Sat, 3 Dec 2022 01:55:38 +0800 Subject: [PATCH] Update site.yml (#2674) * Update site.yml * Update site.yml --- .github/workflows/site.yml | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index f31be9cb2..54d92d9ed 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -13,24 +13,42 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +permissions: + contents: read + pages: write + id-token: write + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on runs-on: ubuntu-latest - + defaults: + run: + working-directory: ./site # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Build website run: | - echo Add other actions to build, - echo test, and deploy your project. + npm ci + npm run build + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./site/build + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1