add web workflow

This commit is contained in:
texm
2023-04-25 15:33:53 +08:00
parent 52d77bf87d
commit 8ca91465f6
2 changed files with 45 additions and 2 deletions

View File

@@ -2,8 +2,6 @@ name: Publish Image
on:
push:
branches:
- 'main'
tags:
- 'v*'

45
.github/workflows/publish-web.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Build and Deploy Web
on:
push:
branches: ["main"]
paths:
- web/**
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/configure-pages@v1
id: pages
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm --prefix web run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./web/build
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v1
id: deployment