From 6a886b66218deaa2bd34d8a119f375d5bd6436ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=AD=90=E6=87=BF?= Date: Tue, 21 Nov 2023 17:38:42 +0800 Subject: [PATCH] add CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄子懿 --- .github/workflows/publish.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..063701d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +# This is a basic workflow to help you get started with Actions + +name: Publish to GitHub Pages + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + +# 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 + - uses: actions/checkout@v2 + + # Run install + - name: Install + run: | + cd tiny-prof-viewer + npm install + + # Run build + - name: Build + run: | + cd tiny-prof-viewer + npm run build --base=/tiny-prof + + # Deploy + - name: Deploy to GitHub Pages + uses: crazy-max/ghaction-github-pages@v4 + with: + target_branch: pages + build_dir: tiny-prof-viewer/dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file