Skip to content

Commit 7de7de0

Browse files
authored
Merge pull request #84 from FusionAuth/jj/remove-self-hosted-runner
remove self-hosted runner
2 parents 60000aa + 6bd04a6 commit 7de7de0

File tree

1 file changed

+37
-25
lines changed

1 file changed

+37
-25
lines changed

.github/workflows/deploy.yaml

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
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+
---
82
name: Deploy
93

104
on:
@@ -28,37 +22,56 @@ permissions:
2822
contents: read
2923

3024
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}
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: 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+
4160
- name: compile
42-
shell: bash -l {0}
4361
run: sb compile
4462

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
5364

5465
- name: set aws credentials
66+
if: inputs.command == 'release' || inputs.command == 'publish'
5567
uses: aws-actions/configure-aws-credentials@v4
5668
with:
5769
role-to-assume: arn:aws:iam::752443094709:role/github-actions
5870
role-session-name: aws-auth-action
5971
aws-region: us-west-2
6072

6173
- name: get secret
74+
if: inputs.command == 'release' || inputs.command == 'publish'
6275
run: |
6376
while IFS=$'\t' read -r key value; do
6477
echo "::add-mask::${value}"
@@ -71,6 +84,7 @@ jobs:
7184
jq -r 'to_entries[] | [.key, .value] | @tsv')
7285
7386
- name: import gpg key
87+
if: inputs.command == 'release' || inputs.command == 'publish'
7488
run: |
7589
export GPG_TTY=$(tty)
7690
echo "${{ env.PRIV_KEY_B64 }}" | base64 -d > /tmp/key.asc
@@ -82,7 +96,7 @@ jobs:
8296
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
8397
8498
- name: configure maven settings.xml
85-
shell: bash -l {0}
99+
if: inputs.command == 'release' || inputs.command == 'publish'
86100
run: |
87101
export KEY_NAME="FusionAuth Platform Team"
88102
export PASSPHRASE="${{ env.PRIV_KEY_PASSWORD }}"
@@ -93,12 +107,10 @@ jobs:
93107
94108
- name: release to svn
95109
if: inputs.command == 'release'
96-
shell: bash -l {0}
97110
run: sb release
98111

99112
- name: publish to maven
100113
if: inputs.command == 'publish'
101-
shell: bash -l {0}
102114
run: |
103115
export GPG_TTY=$(tty)
104116
sb publish

0 commit comments

Comments
 (0)