-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (50 loc) · 1.58 KB
/
cd.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
58
name: Continuous Delivery
on:
push:
branches:
- development
- production
jobs:
cd:
runs-on: ubuntu-latest
permissions:
deployments: write
steps:
- name: Set Up Variables
uses: kanga333/variable-mapper@master
with:
key: ${{ github.ref_name }}
map: |
{
"development": {
"HEROKU_APP_NAME": "writorium-development",
"APP_URL": "https://dev.writorium.site/"
},
"production": {
"HEROKU_APP_NAME": "writorium-production",
"APP_URL": "https://app.writorium.site/"
}
}
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Create Deployment
uses: chrnorm/deployment-action@v2
id: deployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment-url: ${{ env.APP_URL }}
environment: ${{ github.ref_name }}
- name: Deployment
uses: akhileshns/heroku-deploy@v3.12.13
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ env.HEROKU_APP_NAME }}
heroku_email: ${{ secrets.HEROKU_OWNER_EMAIL }}
- name: Update Deployment Status
if: ${{ always() }}
uses: chrnorm/deployment-status@v2
with:
token: '${{ secrets.GITHUB_TOKEN }}'
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: ${{ job.status }}