Skip to content

refactor(deploy): build first and then deploy (#14) #1

refactor(deploy): build first and then deploy (#14)

refactor(deploy): build first and then deploy (#14) #1

name: Build and Deploy
on:
push:
branches: [ "main" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Build
run: go build -v ./cmd/api/main.go
deploy:
name: Deploy app
needs: build
runs-on: ubuntu-latest # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}