Skip to content

Commit

Permalink
🐎 ci: test deploy to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangechen committed Nov 12, 2024
1 parent 9d6fc56 commit 6675ef8
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 27 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: test and deploy

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Run unit tests
run: npm run test

- name: Build
run: |
npm run build
rm -rf dist/*.map
deploy:
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Build
run: |
npm run build
46 changes: 46 additions & 0 deletions .github/workflows/deploy-to-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy chili3d to Pages

on:
push:
branches: [ "test" ]
pull_request:
branches: [ "test" ]

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Build
run: |
npm install
npm run build
rm -rf dist/*.map
- name: Upload GitHub Pages artifact
uses: actions/[email protected]
with:
path: ./dist

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@v4
27 changes: 0 additions & 27 deletions .github/workflows/main.yml

This file was deleted.

0 comments on commit 6675ef8

Please sign in to comment.