-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (49 loc) · 1.57 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Deploy Docker Image
on:
workflow_run:
workflows: ["Build and Push Docker"]
types:
- completed
workflow_dispatch:
env:
APP_URL: https://chatgame.space
APP_ENV: website-production
jobs:
deploy:
name: Deploy image
runs-on: ubuntu-latest
permissions:
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: deployment
with:
token: '${{ github.token }}'
environment-url: ${{ env.APP_URL }}
environment: ${{ env.APP_ENV }}
- name: Restart service on Kosarev.Space
uses: fjogeleit/http-request-action@v1
with:
url: "https://kosarev.space/api/service/${{ secrets.SERVICE_ID }}/restart"
method: 'POST'
bearerToken: '${{ secrets.BEARER_TOKEN }}'
timeout: 15000
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: '${{ github.token }}'
environment-url: ${{ steps.deployment.outputs.environment_url }}
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 }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: 'failure'