Skip to content

Commit

Permalink
ci: update build&deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Renovamen committed Jul 5, 2024
1 parent e033636 commit ad5b939
Showing 2 changed files with 50 additions and 12 deletions.
61 changes: 49 additions & 12 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,57 @@
name: build-and-deploy
name: Build and deploy Nuxt site to Pages

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

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

concurrency:
group: "pages"
cancel-in-progress: false

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

env:
NODE_VERSION: 20

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

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

@@ -35,9 +60,21 @@ jobs:
env:
NUXT_PUBLIC_GOOGLE_FONTS_KEY: ${{ secrets.GOOGLE_FONTS_KEY }}

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/dist
cname: ohmycv.app
path: site/dist

deploy:
needs: build

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

runs-on: ubuntu-latest

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions site/src/public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ohmycv.app

0 comments on commit ad5b939

Please sign in to comment.