Skip to content

Commit

Permalink
FEAT: Deployment status (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 authored Jun 9, 2024
1 parent d32f1cd commit a856eff
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,42 @@ jobs:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group
permissions:
deployments: write
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
- name: Create GitHub deployment πŸ™
uses: chrnorm/deployment-action@v2
id: deployment
with:
route: POST /repos/${{ github.repository }}/deployments
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
environment-url: http://api.web-check.xyz
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 βœ…

- name: Update deployment status (success) βœ…
if: success()
uses: octokit/request-action@v2.3.1
uses: chrnorm/deployment-status@v2
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 }}
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: 'success'

- name: Set deployment status to failure ❌
- name: Update deployment status (failure) ❌
if: failure()
uses: octokit/request-action@v2.3.1
uses: chrnorm/deployment-status@v2
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 }}
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: 'failure'

0 comments on commit a856eff

Please sign in to comment.