2021-11-26 11:40:26 +08:00
|
|
|
name: All_ON_PUSH
|
|
|
|
|
|
|
|
on: push
|
2021-12-06 22:53:37 +08:00
|
|
|
|
2021-11-26 11:40:26 +08:00
|
|
|
jobs:
|
|
|
|
All_ON_PUSH:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-12-06 22:53:37 +08:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
2021-12-15 18:20:45 +08:00
|
|
|
node-version: '16'
|
|
|
|
cache: 'npm'
|
2021-12-06 22:53:37 +08:00
|
|
|
- run: npm install
|
|
|
|
shell: bash
|
|
|
|
- run: echo '${{ github.ref }} ... ${{ github.sha }}'
|
|
|
|
- name: build-site
|
2021-11-26 11:40:26 +08:00
|
|
|
run: npm run build
|
2021-12-06 22:53:37 +08:00
|
|
|
- name: upload surge service and generate preview URL
|
2021-11-26 11:40:26 +08:00
|
|
|
id: deploy
|
|
|
|
run: |
|
2021-12-06 22:53:37 +08:00
|
|
|
export GITHUB_SHA=${{ github.sha }}
|
|
|
|
export GITHUB_SHA_SUB=${GITHUB_SHA: 0: 7 }
|
|
|
|
export DEPLOY_DOMAIN=https://preview-$GITHUB_SHA_SUB-tdesign-vue-next-starter.surge.sh
|
2021-12-15 18:20:45 +08:00
|
|
|
npx surge --project ./dist --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
|
2021-12-06 22:53:37 +08:00
|
|
|
echo the preview URL is $DEPLOY_DOMAIN
|
2021-11-26 11:40:26 +08:00
|
|
|
if: ${{ success() }}
|
2021-12-12 01:04:13 +08:00
|
|
|
- run: echo "🚀 This job's status is ${{ job.status }}."
|