🐛 bump pnpm-lock version #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github Pages Deploy | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Install and Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# cache node_modules | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: Install dependency and build | |
run: | | |
corepack enable | |
pnpm i | |
pnpm build | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: ./build | |
retention-days: 1 | |
deploy-cloudbase: | |
needs: build | |
runs-on: ubuntu-latest | |
name: Deploy Cloudbase | |
steps: | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: cloudbase-cli | |
restore-keys: cloudbase-cli | |
- name: Download Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: ./dist | |
- name: Push to Cloudbase | |
uses: dustella/tcb-actions@4f28fbf9a6f35919ca4d5e98233ed9f0f58a4039 | |
with: | |
secret-id: ${{ secrets.SID }} | |
secret-key: ${{ secrets.SKEY }} | |
env-id: ${{ secrets.ENVID }} | |
dist: ./dist | |
# run: | | |
# npm install -g @cloudbase/cli | |
# npx tcb login --apiKeyId ${{SECRETS.SID}} --apiKey ${{SECRETS.SKEY}} | |
# npx tcb hosting deploy ./dist . -e ${{SECRETS.ENVID}} | |
# on: [push] | |
# jobs: | |
# deploy: | |
# runs-on: ubuntu-latest | |
# permissions: | |
# contents: read | |
# deployments: write | |
# name: Build & Deploy to Cloudflare Pages | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# - name: Setup NodeJs environment | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: 20 | |
# - uses: pnpm/action-setup@v2 | |
# name: Install pnpm | |
# id: pnpm-install | |
# with: | |
# version: 8.6.0 | |
# run_install: false | |
# - name: Get pnpm store directory | |
# id: pnpm-cache | |
# shell: bash | |
# run: | | |
# echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
# - uses: actions/cache@v3 | |
# name: Setup pnpm cache | |
# with: | |
# path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
# restore-keys: | | |
# ${{ runner.os }}-pnpm-store- | |
# - name: Install dependencies | |
# run: pnpm install | |
# - name: Build the project | |
# run: pnpm run build | |
# - name: Publish to Cloudflare Pages | |
# uses: cloudflare/pages-action@1 | |
# with: | |
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
# projectName: nuistcraft | |
# directory: build | |
# # gitHubToken: ${{ secrets.GITHUB_TOKEN }} |