Skip to content

chore: add GitHub Actions #1

chore: add GitHub Actions

chore: add GitHub Actions #1

Workflow file for this run

name: deploy
on:
push:
env:
VERCEL_ORG_ID: ${{secrets.VERCEL_ORG_ID}}
VERCEL_PROJECT_ID: ${{secrets.VERCEL_PROJECT_ID}}
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
- uses: actions/checkout@v3
- run: cd builder && go test -race ./...
preview:
name: Preview Deploy
runs-on: ubunut-latest
needs: [test]
if: github.ref != 'refs/heads/master'
environment:
name: preview
url: ${{steps.deploy.outputs.url}}
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
- uses: actions/checkout@v3
- name: Build pages
run: make build
- name: Instal Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: echo "url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"