From 8ca91465f6b1dd5df11af600a5c8c74b9c55e189 Mon Sep 17 00:00:00 2001 From: texm Date: Tue, 25 Apr 2023 15:33:53 +0800 Subject: [PATCH] add web workflow --- .github/workflows/publish-image.yml | 2 -- .github/workflows/publish-web.yml | 45 +++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-web.yml diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index b0782e0..c328e85 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -2,8 +2,6 @@ name: Publish Image on: push: - branches: - - 'main' tags: - 'v*' diff --git a/.github/workflows/publish-web.yml b/.github/workflows/publish-web.yml new file mode 100644 index 0000000..15f3960 --- /dev/null +++ b/.github/workflows/publish-web.yml @@ -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 \ No newline at end of file