Skip to content

Commit

Permalink
Update deploy to use environment
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhEugene committed Jan 26, 2024
1 parent 22b2202 commit 635c4e0
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
name: Deploy

concurrency:
group: deploy

on:
workflow_dispatch:


jobs:
deploy:
environment: Production
runs-on: ubuntu-latest
steps:
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
environment: Production
environment-url: ${{ vars.ENVIRONMENT_URL }}
log-url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
ref: ${{ vars.BRANCH }}
production-environment: true
initial-status: "in_progress"
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
script: make redeploy
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
environment-url: ${{ steps.deployment.outputs.environment_url }}
log-url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "success"
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
environment-url: ${{ steps.deployment.outputs.environment_url }}
log-url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "failure"

0 comments on commit 635c4e0

Please sign in to comment.