-
Notifications
You must be signed in to change notification settings - Fork 657
119 lines (109 loc) · 4.13 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-jdk11-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-jdk11
- name: Create Artifacts
run: |
./generate_samples.sh
# delete uncompressed output, sample zips are in ./samples/
rm -rf output/
./gradlew uberJar javadoc graphviz
mkdir -p output/build/javadoc
mv build/docs/javadoc/* output/build/javadoc
- name: Delete Previous master-branch-latest Tag
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: master-branch-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
# note id is referenced below in Deploy uberJar
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: master-branch-latest
draft: false
prerelease: true
- name: Deploy UberJar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`
asset_path: build/libs/synthea-with-dependencies.jar
asset_name: synthea-with-dependencies.jar
asset_content_type: application/java-archive
# it's necessary to add another "publish" after the upload, otherwise the release is always listed as "draft"
# see https://github.com/actions/upload-release-asset/issues/34
- name: Publish Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitBodyDuringUpdate: true
replacesArtifacts: false
tag: master-branch-latest
token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
# note: watch for v4 to be released
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
# do not create a .nojekyll file
enable_jekyll: true
publish_dir: ./output
user_name: 'Jason Walonoski'
user_email: '[email protected]'
commit_message: rebuild graphs, javadoc and binary distribution at
# note the commit SHA is appended automatically
- name: Push samples to sample repo
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.PUSH_SAMPLE_DATA_SSH_KEY }}
with:
source-directory: 'samples'
destination-github-username: 'synthetichealth'
destination-repository-name: 'synthea-sample-data'
target-directory: 'downloads/latest'
target-branch: main
- name: Slack Notification on Failure
uses: 8398a7/action-slack@v3
if: failure()
with:
status: custom
job_name: Deploy
author_name: Deploy Workflow
fields: workflow,commit,repo,author,took
# see https://action-slack.netlify.app/usecase/02-custom for custom payload info
custom_payload: |
{
attachments: [{
color: 'danger',
text: `${process.env.AS_WORKFLOW} -- (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@master by ${process.env.AS_AUTHOR} ${{ job.status }} in ${process.env.AS_TOOK}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}