Skip to content

FEAT: Deployment status (#25) #9

FEAT: Deployment status (#25)

FEAT: Deployment status (#25) #9

Workflow file for this run

name: πŸš€ Deploy to Fly
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
- name: Setup Fly 🧰
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Create GitHub Deployment πŸ™
id: create_deployment
uses: octokit/request-action@v2.3.1
with:
route: POST /repos/${{ github.repository }}/deployments
environment: production
ref: ${{ github.sha }}
description: "Deploying to Fly.io"
auto_merge: false
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
- name: Deploy to Fly.io πŸ›©οΈ
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
- name: Set deployment status to success βœ…
if: success()
uses: octokit/request-action@v2.3.1
with:
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses
state: success
description: "βœ… Deployment Succeeded πŸ₯³"
environment: production
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
- name: Set deployment status to failure ❌
if: failure()
uses: octokit/request-action@v2.3.1
with:
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.id }}/statuses
state: failure
description: "❌ Deployment Failed πŸ˜₯"
environment: production
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}