1
- # Run locally with act:
2
- #
3
- # act pull_request [--input command=[command]] \
4
- # --platform fusionauth-standard=[ecr-repo-name]/fusionauth-standard:latest] \
5
- # --workflows ./.github/workflows/deploy.yaml \
6
- # --env-file <(aws configure export-credentials --profile [aws-profile] --format env)
7
-
1
+ ---
8
2
name : Deploy
9
3
10
4
on :
@@ -28,37 +22,56 @@ permissions:
28
22
contents : read
29
23
30
24
jobs :
31
- build :
32
- if : |
33
- github.event_name == 'pull_request' ||
34
- github.event_name == 'push' ||
35
- github.event_name == 'workflow_dispatch' && inputs.command == 'build'
36
- runs-on : fusionauth-standard
25
+ deploy :
26
+ runs-on : ubuntu-latest
27
+ defaults :
28
+ run :
29
+ shell : /usr/bin/bash -l -e -o pipefail {0}
37
30
steps :
38
31
- name : checkout
39
32
uses : actions/checkout@v4
40
33
34
+ - name : setup java
35
+ uses : actions/setup-java@v4
36
+ with :
37
+ distribution : temurin
38
+ java-version : 8
39
+ java-package : jdk
40
+
41
+ - name : setup java
42
+ uses : actions/setup-java@v4
43
+ with :
44
+ distribution : temurin
45
+ java-version : 21
46
+ java-package : jdk
47
+
48
+ - name : install savant
49
+ run : |
50
+ curl -O https://repository.savantbuild.org/org/savantbuild/savant-core/2.0.0/savant-2.0.0.tar.gz
51
+ tar xzvf savant-2.0.0.tar.gz
52
+ savant-2.0.0/bin/sb --version
53
+ SAVANT_PATH=$(realpath -s "./savant-2.0.0/bin")
54
+ echo "${SAVANT_PATH}" >> $GITHUB_PATH
55
+ mkdir -p ~/.savant/plugins
56
+ cat << EOF > ~/.savant/plugins/org.savantbuild.plugin.java.properties
57
+ 1.8=${JAVA_HOME}
58
+ EOF
59
+
41
60
- name : compile
42
- shell : bash -l {0}
43
61
run : sb compile
44
62
45
- deploy :
46
- if : |
47
- github.event_name == 'workflow_dispatch' &&
48
- (inputs.command == 'release' || inputs.command == 'publish')
49
- runs-on : fusionauth-standard
50
- steps :
51
- - name : checkout
52
- uses : actions/checkout@v4
63
+ # ## Everything below this line will only run on a workflow_dispatch
53
64
54
65
- name : set aws credentials
66
+ if : inputs.command == 'release' || inputs.command == 'publish'
55
67
uses : aws-actions/configure-aws-credentials@v4
56
68
with :
57
69
role-to-assume : arn:aws:iam::752443094709:role/github-actions
58
70
role-session-name : aws-auth-action
59
71
aws-region : us-west-2
60
72
61
73
- name : get secret
74
+ if : inputs.command == 'release' || inputs.command == 'publish'
62
75
run : |
63
76
while IFS=$'\t' read -r key value; do
64
77
echo "::add-mask::${value}"
71
84
jq -r 'to_entries[] | [.key, .value] | @tsv')
72
85
73
86
- name : import gpg key
87
+ if : inputs.command == 'release' || inputs.command == 'publish'
74
88
run : |
75
89
export GPG_TTY=$(tty)
76
90
echo "${{ env.PRIV_KEY_B64 }}" | base64 -d > /tmp/key.asc
82
96
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
83
97
84
98
- name : configure maven settings.xml
85
- shell : bash -l {0}
99
+ if : inputs.command == 'release' || inputs.command == 'publish'
86
100
run : |
87
101
export KEY_NAME="FusionAuth Platform Team"
88
102
export PASSPHRASE="${{ env.PRIV_KEY_PASSWORD }}"
@@ -93,12 +107,10 @@ jobs:
93
107
94
108
- name : release to svn
95
109
if : inputs.command == 'release'
96
- shell : bash -l {0}
97
110
run : sb release
98
111
99
112
- name : publish to maven
100
113
if : inputs.command == 'publish'
101
- shell : bash -l {0}
102
114
run : |
103
115
export GPG_TTY=$(tty)
104
116
sb publish
0 commit comments