Skip to content

Update build.yml

Update build.yml #1

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
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Build
run: |
pnpm i
pnpm run build
- name: Configure git user
run: |
hub config --global user.name "github-actions[bot]"
hub config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Push
run: |
cd dist
hub init -b public_html
hub add .
hub commit -m "Build public_html [Github actions]"
echo hub remote add output https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
hub remote add output https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
hub push -fu output public_html