Skip to content

Commit

Permalink
chore: add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed Dec 31, 2023
1 parent 04f06d3 commit faa40aa
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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 }})"

0 comments on commit faa40aa

Please sign in to comment.