-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
review-app.yaml
43 lines (39 loc) · 1.37 KB
/
review-app.yaml
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
---
name: 'deploy'
# yamllint disable-line rule:truthy
on:
# onl run this workflow on pull request events
pull_request
jobs:
review_app:
runs-on: ubuntu-latest
# only run when a pull request is opened
if: github.event_name == 'pull_request' && github.event.action == 'opened'
steps:
- name: Cloning repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to dokku
uses: dokku/github-action@master
with:
# create a review app
command: review-apps:create
git_remote_url: 'ssh://[email protected]:22/appname'
# specify a name for the review app
review_app_name: review-appname-${{ github.event.pull_request.number }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
destroy_review_app:
runs-on: ubuntu-latest
# only run when a pull request is closed
if: github.event_name == 'pull_request' && github.event.action == 'closed'
steps:
- name: Destroy the review app
uses: dokku/github-action@master
with:
# destroy a review app
command: review-apps:destroy
git_remote_url: 'ssh://[email protected]:22/appname'
# specify a name for the review app
review_app_name: review-appname-${{ github.event.pull_request.number }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}