👷 update ci

This commit is contained in:
yanyongyu 2021-02-10 12:58:24 +08:00
parent 17c7903bee
commit aba18a2f68

View File

@ -2,7 +2,7 @@ name: Build Upload Site
on: on:
push: push:
branches: [master, dev] pull_request:
jobs: jobs:
publish: publish:
@ -32,19 +32,20 @@ jobs:
- name: Get Branch Name - name: Get Branch Name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Get Site ID - name: Production Deploy
if: env.BRANCH_NAME == 'master' if: github.event_name == 'push' && env.BRANCH_NAME == 'master'
run: | uses: nwtgck/actions-netlify@v1.1
echo "NETLIFY_SITE_ID=${{ secrets.PROD_SITE_ID }}" >> $GITHUB_ENV
- name: Get Site ID
if: env.BRANCH_NAME == 'dev'
run: |
echo "NETLIFY_SITE_ID=${{ secrets.DEV_SITE_ID }}" >> $GITHUB_ENV
- name: Publish
uses: netlify/actions/cli@master
with: with:
args: deploy --dir=docs/.vuepress/dist --prod --message='Production ${{ env.BRANCH_NAME }}@${{ github.sha }}' publish-dir: './docs/.vuepress/dist'
env: production-branch: ${{ env.BRANCH_NAME }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Production Deploy ${{ env.BRANCH_NAME }}@${{ github.sha }}'
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1
with:
publish-dir: './docs/.vuepress/dist'
production-branch: ${{ env.BRANCH_NAME }}
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy ${{ env.BRANCH_NAME }}@${{ github.sha }}'