👷 update ci

This commit is contained in:
yanyongyu 2021-02-10 13:53:41 +08:00
parent 7b2af1b2f3
commit 3cc738c205

View File

@ -32,6 +32,14 @@ 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 Deploy Name
if: github.event_name == 'push'
run: echo "DEPLOY_NAME=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV
- name: Get Deploy Name
if: github.event_name != 'push'
run: echo "DEPLOY_NAME=deploy-preview-${{ github.event.number }}" >> $GITHUB_ENV
- name: Deploy to Netlify - name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1 uses: nwtgck/actions-netlify@v1.1
with: with:
@ -39,6 +47,7 @@ jobs:
production-branch: master production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy ${{ env.BRANCH_NAME }}@${{ github.sha }}' deploy-message: 'Deploy ${{ env.BRANCH_NAME }}@${{ github.sha }}'
alias: ${{ env.DEPLOY_NAME }}
env: env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.SITE_ID }} NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}