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+ ---
82name : Deploy
93
104on :
@@ -28,37 +22,49 @@ permissions:
2822 contents : read
2923
3024jobs :
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}
3730 steps :
3831 - name : checkout
3932 uses : actions/checkout@v4
4033
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+
4153 - name : compile
42- shell : bash -l {0}
4354 run : sb compile
4455
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
5357
5458 - name : set aws credentials
59+ if : inputs.command == 'release' || inputs.command == 'publish'
5560 uses : aws-actions/configure-aws-credentials@v4
5661 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
5863 role-session-name : aws-auth-action
5964 aws-region : us-west-2
6065
6166 - name : get secret
67+ if : inputs.command == 'release' || inputs.command == 'publish'
6268 run : |
6369 while IFS=$'\t' read -r key value; do
6470 echo "::add-mask::${value}"
@@ -71,17 +77,16 @@ jobs:
7177 jq -r 'to_entries[] | [.key, .value] | @tsv')
7278
7379 - name : create npmrc
80+ if : inputs.command == 'release' || inputs.command == 'publish'
7481 run : |
7582 echo "color=false" > ~/.npmrc
7683 echo "//registry.npmjs.org/:_authToken=${{ env.API_KEY }}" >> ~/.npmrc
7784 chmod 600 ~/.npmrc
7885
7986 - name : release to svn
8087 if : inputs.command == 'release'
81- shell : bash -l {0}
8288 run : sb release
8389
8490 - name : publish to npmjs
8591 if : inputs.command == 'publish'
86- shell : bash -l {0}
8792 run : sb publish
0 commit comments