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,49 @@ 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 : 21
39
+ java-package : jre
40
+
41
+ - name : install savant
42
+ run : |
43
+ curl -O https://repository.savantbuild.org/org/savantbuild/savant-core/2.0.0/savant-2.0.0.tar.gz
44
+ tar xzvf savant-2.0.0.tar.gz
45
+ savant-2.0.0/bin/sb --version
46
+ SAVANT_PATH=$(realpath -s "./savant-2.0.0/bin")
47
+ echo "${SAVANT_PATH}" >> $GITHUB_PATH
48
+ mkdir -p ~/.savant/plugins
49
+ cat << EOF > ~/.savant/plugins/org.savantbuild.plugin.java.properties
50
+ 21=${JAVA_HOME}
51
+ EOF
52
+
41
53
- name : compile
42
- shell : bash -l {0}
43
54
run : sb compile
44
55
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
56
+ # ## Everything below this line will only run on a workflow_dispatch
53
57
54
58
- name : set aws credentials
59
+ if : inputs.command == 'release' || inputs.command == 'publish'
55
60
uses : aws-actions/configure-aws-credentials@v4
56
61
with :
57
- role-to-assume : arn:aws:iam::752443094709:role/github-actions
62
+ role-to-assume : arn:aws:iam::752443094709:role/gha-fusionauth-typescript-client
58
63
role-session-name : aws-auth-action
59
64
aws-region : us-west-2
60
65
61
66
- name : get secret
67
+ if : inputs.command == 'release' || inputs.command == 'publish'
62
68
run : |
63
69
while IFS=$'\t' read -r key value; do
64
70
echo "::add-mask::${value}"
@@ -71,17 +77,16 @@ jobs:
71
77
jq -r 'to_entries[] | [.key, .value] | @tsv')
72
78
73
79
- name : create npmrc
80
+ if : inputs.command == 'release' || inputs.command == 'publish'
74
81
run : |
75
82
echo "color=false" > ~/.npmrc
76
83
echo "//registry.npmjs.org/:_authToken=${{ env.API_KEY }}" >> ~/.npmrc
77
84
chmod 600 ~/.npmrc
78
85
79
86
- name : release to svn
80
87
if : inputs.command == 'release'
81
- shell : bash -l {0}
82
88
run : sb release
83
89
84
90
- name : publish to npmjs
85
91
if : inputs.command == 'publish'
86
- shell : bash -l {0}
87
92
run : sb publish
0 commit comments