Update main.yml #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#original https://www.programonaut.com/how-to-deploy-a-git-repository-to-a-server-using-github-actions/ | |
name: Deploy to surge.sh | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
workflow_dispatch: | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
ENVIRONMENT: dev | |
CNAME: watermelontest.surge.sh | |
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} | |
jobs: | |
Deploy-to-Surge: | |
name: Deploy | |
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '14' | |
- run: | | |
echo "SURGE_LOGIN length: ${#SURGE_LOGIN}" | |
echo "CNAME length: ${CNAME}" | |
npm install --global surge | |
surge . $CNAME |