Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/workflows/deploy-fly.yaml

This file was deleted.

31 changes: 25 additions & 6 deletions .github/workflows/go.yaml → .github/workflows/haystack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Check formatting
run: |
go fmt ./...
make fmt
if [ -n "$(git diff --name-only)" ]; then
echo "Code is not properly formatted. Please run 'make fmt'"
git diff
Expand Down Expand Up @@ -64,24 +64,43 @@ jobs:
runs-on: ubuntu-latest
needs: [quality-checks, test]
# Only build and push Docker images on main branch after tests pass
# Note: Fly.io deployment happens in a separate workflow (deploy-fly.yaml)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build info
run: make docker-info

- name: Build and push Docker image
run: make docker-push
env:
DOCKER_PUSH: true

deploy:
runs-on: ubuntu-latest
needs: docker-build
# Deploy to Fly.io after Docker image is built and pushed
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: trunk
steps:
- uses: actions/checkout@v4

- name: Setup Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master

- name: Deploy to Fly.io
run: |
cd examples/deployments/fly.io
./deploy.sh
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
10 changes: 8 additions & 2 deletions examples/deployments/fly.io/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,20 @@ main() {
log_info "Deploying image: ${image_tag}"

# Deploy to Fly.io
if fly deploy --config fly.toml.generated; then
# Use flyctl if available (GitHub Actions), otherwise fall back to fly
FLY_CMD="fly"
if command -v flyctl >/dev/null 2>&1; then
FLY_CMD="flyctl"
fi

if $FLY_CMD deploy --config fly.toml.generated; then
log_info "✓ Deployment successful!"

# Clean up generated file
rm -f fly.toml.generated

# Show app info
fly status
$FLY_CMD status
else
log_error "Deployment failed!"
rm -f fly.toml.generated
Expand Down