Skip to content

Deploy to surge

Deploy to surge #4

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Main
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: ".nvmrc"
- name: Install
run: npm ci --prefer-offline --no-audit
- name: Lint
run: npm run lint
- name: Unit test
run: npm test
- name: Build
run: npm run build
deploy:
needs: test
if: github.ref_name == 'master'
concurrency: production
runs-on: ubuntu-latest
environment:
name: production
url: ${{ vars.SURGE_DOMAIN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: ".nvmrc"
- name: Install
run: npm install --prefer-offline --no-audit
- name: Build
run: npm run build
- name: Deploy
run: npx surge ./dist ${{ vars.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}