Skip to content

Commit

Permalink
fix: update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto0226 committed Dec 23, 2024
1 parent a460dc0 commit 835d998
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
name: deploy
name: Deploy to GitHub Pages

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

jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: πŸ›ŽοΈ Checkout code
- name: πŸ›ŽοΈ Checkout repository
uses: actions/checkout@v4

- name: πŸ“¦ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: πŸ“₯ Install dependencies
run: npm install
run: npm ci

- name: πŸ—οΈ Build
- name: πŸ” Lint check
run: npm run lint

- name: πŸ—οΈ Build project
run: npm run build
env:
NODE_ENV: production

- name: πŸš€Deploy to GitHub PagesπŸš€ # --> this deploys to gh-pages
if: github.ref == 'refs/heads/main'
- name: πŸš€ Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
commit_message: 'deploy: ${{ github.event.head_commit.message }}'
enable_jekyll: false
cname: ${{ secrets.CNAME }}

0 comments on commit 835d998

Please sign in to comment.