summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorMetaCubeX <[email protected]>2022-05-26 00:12:49 +0800
committerMetaCubeX <[email protected]>2022-05-26 00:12:49 +0800
commit039c66304e893a61598eb0bb87df6fb8c26b58a7 (patch)
tree57005dc2d86230d0aba6bc0c6fd96444935133f1 /.github/workflows
parentccd2eb721166f155fd614aedd92bc2fa287cb677 (diff)
chore: yml
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/push.yml125
1 files changed, 23 insertions, 102 deletions
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index 3690f4d..c9e2ac5 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -1,109 +1,30 @@
+name: Deploy
+
on: [push]
-name: Deploy workflow
-jobs:
- install:
- runs-on: ubuntu-20.04
- strategy:
- matrix:
- node-version: [16.x]
+jobs:
+ build:
+ runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
-
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v3
- with:
- node-version: ${{ matrix.node-version }}
-
- - name: Cache pnpm modules
- uses: actions/cache@v3
- with:
- path: ~/.pnpm-store
- key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- restore-keys: |
- ${{ runner.os }}-
-
- - uses: pnpm/[email protected]
+ - name: Checkout Dashboard code
+ uses: actions/checkout@v3
+ - uses: pnpm/action-setup@v2
with:
- version: 7
- run_install: true
-
- - name: Lint
- run: pnpm lint
- - name: Build
- run: pnpm build
-
- - name: Create Release
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
- id: create_release
- uses: actions/create-release@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ version: latest
+ - name: Setup Nodejs
+ uses: actions/setup-node@v3
with:
- tag_name: ${{ github.ref }}
- release_name: ${{ github.ref }}
- draft: true
- prerelease: false
- - name: Create Tar Ball
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
- run: tar cJf yacd.tar.xz public
- - name: Upload Release Asset
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
- id: upload-release-asset
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ node-version: '17.x'
+ cache: pnpm
+ - name: Install package and build
+ run: |
+ pnpm install
+ pnpm build
+ - name: Deploy
+ uses: crazy-max/ghaction-github-pages@v2
with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: ./yacd.tar.xz
- asset_name: yacd.tar.xz
- asset_content_type: application/x-gzip
-
- - name: Push to gh-pages
- #if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags/') || github.event.ref == 'refs/heads/publish')
+ target_branch: gh-pages
+ build_dir: dist
+ fqdn: yacd.metacubex.one
env:
- GITHUB_TOKEN: ${{ secrets.GITPAGE_TOKEN }}
- PUBLISH_DIR: public
- BRANCH: gh-pages
- run: |
- cd $PUBLISH_DIR
- ls -l
- git init
- git config user.name "${GITHUB_ACTOR}"
- git config user.email "${GITHUB_ACTOR}@noreply.github.com"
- git add .
- git status
- git commit -m "Push to gh-pages"
- git push -f https://$GITHUB_ACTOR:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:$BRANCH
- echo "yacd.clash-plus.tk" > CNAME
- rm -rf .git/
- git init
- git config user.name "${GITHUB_ACTOR}"
- git config user.email "${GITHUB_ACTOR}@noreply.github.com"
- git add .
- git commit -m "Push to gh-pages"
- git push -f https://$GITHUB_ACTOR:${GITHUB_TOKEN}@github.com/${GITHUB_ACTOR}/pagek.git HEAD:$BRANCH
- echo "yacd.clash-plus.ml" > CNAME
- rm -rf .git/
- git init
- git config user.name "${GITHUB_ACTOR}"
- git config user.email "${GITHUB_ACTOR}@noreply.github.com"
- git add .
- git commit -m "Push to gh-pages"
- git push -f https://$GITHUB_ACTOR:${GITHUB_TOKEN}@github.com/${GITHUB_ACTOR}/pagel.git HEAD:$BRANCH
- echo "yacd.clash-plus.ga" > CNAME
- rm -rf .git/
- git init
- git config user.name "${GITHUB_ACTOR}"
- git config user.email "${GITHUB_ACTOR}@noreply.github.com"
- git add .
- git commit -m "Push to gh-pages"
- git push -f https://$GITHUB_ACTOR:${GITHUB_TOKEN}@github.com/${GITHUB_ACTOR}/pagea.git HEAD:$BRANCH
- echo "yacd.clash-plus.gq" > CNAME
- rm -rf .git/
- git init
- git config user.name "${GITHUB_ACTOR}"
- git config user.email "${GITHUB_ACTOR}@noreply.github.com"
- git add .
- git commit -m "Push to gh-pages"
- git push -f https://$GITHUB_ACTOR:${GITHUB_TOKEN}@github.com/${GITHUB_ACTOR}/pageq.git HEAD:$BRANCH
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file