Skip to content

Update build.yml

Update build.yml #20

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build Site
# Controls when the action will run.
on:
# Manual workflow triggering
workflow_dispatch:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
check-latest: true
- name: Build
run: |
pnpm i
pnpm run build
# Deploy to branch
- name: Deploy to branch
uses: s0/[email protected]
env:
REPO: self
BRANCH: public_html
FOLDER: dist
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SQUASH_HISTORY: true
COMMIT_NAME: 'github-actions[bot]'
COMMIT_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
# Deploy to other repo
- name: Deploy to repo
uses: s0/[email protected]
env:
REPO: [email protected]:codingfun1072/embed_deploy.git
BRANCH: main
FOLDER: dist
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_PRIVATE_KEY }}
TARGET_DIR: dist
COMMIT_NAME: 'github-actions[bot]'
COMMIT_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'