Skip to content

Commit

Permalink
build: new yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
kyziq committed Jan 10, 2024
1 parent 643b4bf commit 8b445a4
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions .github/workflows/deploy-stage.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
name: Build and Deploy to GitHub Pages
name: Deploy static content to Pages

on:
push:
branches:
- main
branches: ['main']
workflow_dispatch:

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

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
build-and-deploy:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: '18'
cache: 'pnpm'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
version: '8'

- name: Install dependencies
run: pnpm install

- name: Build Static Content
run: pnpm run build

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: dist
clean: true
path: './dist' # Ensure your build output is in the 'dist' directory

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 8b445a4

Please sign in to comment.