Skip to content

Commit

Permalink
chore: simplify deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
aekasitt committed Nov 14, 2024
1 parent 0a085ad commit 367b7eb
Showing 1 changed file with 26 additions and 30 deletions.
56 changes: 26 additions & 30 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,51 @@
name: Deploy to GitHub Pages
name: Deploy

on:
push:
branches:
- master
workflow_dispatch:

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

steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.5.0
- name: install Nodejs
uses: actions/setup-node@v3
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 20
cache: 'pnpm'
node-version: 18

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

- name: Build project
run: pnpm run build
run: npm run build

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

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

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

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Download artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v2
with:
name: github-pages
name: production-files
path: ./dist

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

0 comments on commit 367b7eb

Please sign in to comment.