forked from emartinez-usgs/code-json-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 1.68 KB
/
daily-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
58
59
60
61
62
63
64
65
66
67
68
69
name: "Daily code.json deployment to cloud.gov"
on:
schedule:
# Run at 6:15 pm UTC (2:15 pm EST) every day
- cron: '15 18 * * *'
jobs:
build:
name: Build
runs-on: "ubuntu-latest"
steps:
- name: Check out code
uses: actions/checkout@v2
run:
name: Run
runs-on: "ubuntu-latest"
needs: build
env:
CF_USERNAME: ${{ secrets.CG_USERNAME}}
CF_PASSWORD: ${{ secrets.CG_PASSWORD}}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run code json generator
run: |
./bin/run-codejsongenerator && echo "Run code json generator"
- name: Commit & Push
if: ${{ success() }}
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch --depth=1 origin output-cloudgov
git worktree add -b output-cloudgov ../output-cloudgov origin/output-cloudgov
mv code.json ../output-cloudgov/code.json
cd ../output-cloudgov/
git add .
git commit -m "Automated workflow from GitHub Actions"
git push origin output-cloudgov
pwd
cd ..
pwd
cd code-json-generator
ls
git checkout output-cloudgov -- code.json
ls
- name: Make the cloudgov-deploy script executable
if: ${{ success() }}
run: |
chmod +x ./bin/deploy-cloudgov
- name: Deploy the app to cloud.gov
if: ${{ success() }}
run: |
pwd
ls
git checkout output-cloudgov -- code.json
ls
./bin/deploy-cloudgov && echo "Deploy"