Skip to content

Commit

Permalink
add some setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuiantw1212 committed Feb 1, 2024
1 parent f71e889 commit 36a151e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
name: Build static content and deploy to Pages

# https://github.com/actions/toolkit/issues/952
permissions:
id-token: write
contents: read
pages: write
id-token: write

on:
push:
branches: [ "econ-sense-vite-press" ]
pull_request:
branches: [ "econ-sense-vite-press" ]

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
Expand All @@ -27,21 +34,20 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present

- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: .vitepress/dist/
if-no-files-found: error

# Deployment job
deploy:
Expand Down

0 comments on commit 36a151e

Please sign in to comment.