-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4dba1c3
commit 6e1b10f
Showing
1 changed file
with
42 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,49 @@ | ||
name: cd | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static content to Pages | ||
|
||
on: [push, pull_request] | ||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
cd: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [18] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
- name: Setup node env | ||
uses: actions/setup-node@v4 | ||
|
||
with: | ||
node-version: ${{ matrix.node }} | ||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
- name: Install dependencies | ||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
container: node:18.14.0 | ||
steps: | ||
- name: 🛎️ Checkout | ||
uses: actions/checkout@v3 | ||
- name: 📦 Install | ||
run: npm i | ||
|
||
- name: Generate | ||
run: npm run generate | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
- name: ✅ Test | ||
run: npm run test:unit | ||
- name: 🏗 Build | ||
run: npm run build | ||
- name: ⚙️ Setup Pages | ||
uses: actions/configure-pages@v2 | ||
- name: ⬆️ Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist | ||
# Upload entire repository | ||
path: './dist' | ||
- name: 🚀 Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |