Skip to content

Commit

Permalink
separate build and deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
lue-bird committed Oct 6, 2024
1 parent 26b9f8f commit bfdd321
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/to-github.-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@ concurrency:
cancel-in-progress: false

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Build project
run: npx vite build

- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: production-files
path: ./dist

deploy:
environment:
name: github-pages
Expand All @@ -31,19 +54,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Build js dependencies
uses: bahmutov/npm-install@v1

- run: npx vite build

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
- name: Download artifact
uses: actions/download-artifact@v3
with:
path: '.'
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
id: deployment
uses: actions/deploy-pages@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

0 comments on commit bfdd321

Please sign in to comment.