Skip to content

github-pages

github-pages #248

Workflow file for this run

name: github-pages
on:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '30 23 * * 0'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build NuxtJS
runs-on: ubuntu-20.04
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
WK_TOKEN: ${{ secrets.WK_TOKEN }}
SSO_APP_ID: ${{ secrets.SSO_APP_ID }}
SSO_APP_REDIRECT: ${{ secrets.SSO_APP_REDIRECT }}
SSO_BASE_URL: ${{ secrets.SSO_BASE_URL }}
steps:
- name: Checkout SourceCode
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "18"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: true
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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: Collector Data 🔧
# run: pnpm collector
- name: Build 🔧
run: pnpm build
- name: Upload artifact 🚀
if: success() && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v2
with:
path: ./dist
# Deployment job
deploy:
name: Deploy to GitHub Pages
if: github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-20.04
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2