feat(ci): linting and previews
This commit is contained in:
30
.github/workflows/check.yml
vendored
Normal file
30
.github/workflows/check.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Checks
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
if: ${{ github.repository == 'dot013/.www-new' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22.2'
|
||||
- name: Check
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: v1.58
|
||||
33
.github/workflows/deploy-preview.yml
vendored
Normal file
33
.github/workflows/deploy-preview.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Deploy preview to vercel
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Checks
|
||||
types:
|
||||
- completed
|
||||
branches-ignore:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy preview
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'dot013/.www-new' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22.2'
|
||||
- name: Build
|
||||
run: |
|
||||
go install github.com/a-h/templ/cmd/templ@latest
|
||||
make build-vercel
|
||||
- name: Deploy
|
||||
uses: amondnet/vercel-action@v25
|
||||
with:
|
||||
vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
||||
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
|
||||
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
8
.github/workflows/deploy.yml
vendored
8
.github/workflows/deploy.yml
vendored
@@ -1,12 +1,18 @@
|
||||
name: Deploy to vercel
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Checks
|
||||
types:
|
||||
- completed
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy
|
||||
if: ${{ github.repository == 'dot013/.www-new' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
Reference in New Issue
Block a user