Skip to content

remove self-hosted runner to main #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 37 additions & 25 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# Run locally with act:
#
# act pull_request [--input command=[command]] \
# --platform fusionauth-standard=[ecr-repo-name]/fusionauth-standard:latest] \
# --workflows ./.github/workflows/deploy.yaml \
# --env-file <(aws configure export-credentials --profile [aws-profile] --format env)

---
name: Deploy

on:
Expand All @@ -28,37 +22,56 @@ permissions:
contents: read

jobs:
build:
if: |
github.event_name == 'pull_request' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' && inputs.command == 'build'
runs-on: fusionauth-standard
deploy:
runs-on: ubuntu-latest
defaults:
run:
shell: /usr/bin/bash -l -e -o pipefail {0}
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-package: jdk

- name: setup java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
java-package: jdk

- name: install savant
run: |
curl -O https://repository.savantbuild.org/org/savantbuild/savant-core/2.0.0/savant-2.0.0.tar.gz
tar xzvf savant-2.0.0.tar.gz
savant-2.0.0/bin/sb --version
SAVANT_PATH=$(realpath -s "./savant-2.0.0/bin")
echo "${SAVANT_PATH}" >> $GITHUB_PATH
mkdir -p ~/.savant/plugins
cat << EOF > ~/.savant/plugins/org.savantbuild.plugin.java.properties
1.8=${JAVA_HOME}
EOF

- name: compile
shell: bash -l {0}
run: sb compile

deploy:
if: |
github.event_name == 'workflow_dispatch' &&
(inputs.command == 'release' || inputs.command == 'publish')
runs-on: fusionauth-standard
steps:
- name: checkout
uses: actions/checkout@v4
### Everything below this line will only run on a workflow_dispatch

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

- name: get secret
if: inputs.command == 'release' || inputs.command == 'publish'
run: |
while IFS=$'\t' read -r key value; do
echo "::add-mask::${value}"
Expand All @@ -71,6 +84,7 @@ jobs:
jq -r 'to_entries[] | [.key, .value] | @tsv')

- name: import gpg key
if: inputs.command == 'release' || inputs.command == 'publish'
run: |
export GPG_TTY=$(tty)
echo "${{ env.PRIV_KEY_B64 }}" | base64 -d > /tmp/key.asc
Expand All @@ -82,7 +96,7 @@ jobs:
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf

- name: configure maven settings.xml
shell: bash -l {0}
if: inputs.command == 'release' || inputs.command == 'publish'
run: |
export KEY_NAME="FusionAuth Platform Team"
export PASSPHRASE="${{ env.PRIV_KEY_PASSWORD }}"
Expand All @@ -93,12 +107,10 @@ jobs:

- name: release to svn
if: inputs.command == 'release'
shell: bash -l {0}
run: sb release

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