From ce39ca11baa1a7ddd2e49bc67ceb63797b26e312 Mon Sep 17 00:00:00 2001 From: tsengyushiang Date: Sat, 14 Sep 2024 14:34:43 +0800 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..aa582e8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: DeployGihubPage + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - run: | + yarn install + yarn build + touch ./dist/.nojekyll + git config --global user.email "github@example.com" + git config --global user.name "git workflows" + git add dist/ -f + git commit -m "Deploy gh-pages" + #git subtree push --prefix dist origin gh-pages + git subtree split --prefix dist -b gh-pages + git push -f origin gh-pages:gh-pages + git branch -D gh-pages