Skip to content

Commit

Permalink
Merge pull request #34 from FusionAuth/jj/release-workflow
Browse files Browse the repository at this point in the history
add release workflow
  • Loading branch information
johnjeffers authored Jun 7, 2024
2 parents 45f5187 + fd32e77 commit 424af6e
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Run locally with act:
#
# act pull_request [--input command=[command]] \
# --platform fusionauth-builder=[ecr-repo-name]/fusionauth-builder:latest] \
# --workflows ./.github/workflows/release.yaml \
# --env-file <(aws configure export-credentials --profile [aws-profile] --format env)

name: Deploy

on:
workflow_dispatch:
inputs:
command:
type: choice
options:
- publish # publish to packagist
- release # release to svn

permissions:
contents: read

jobs:
deploy:
if: |
github.event_name == 'workflow_dispatch' &&
(inputs.command == 'release' || inputs.command == 'publish')
runs-on: fusionauth-builder
steps:
- name: checkout
uses: actions/checkout@v4

- name: set aws credentials
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
run: |
while IFS=$'\t' read -r key value; do
echo "::add-mask::${value}"
echo "${key}=${value}" >> $GITHUB_ENV
done < <(aws secretsmanager get-secret-value \
--region us-west-2 \
--secret-id platform/php-packagist \
--query SecretString \
--output text | \
jq -r 'to_entries[] | [.key, .value] | @tsv')
- name: update savant properties file
run: |
echo "packagistUsername=${{ env.USERNAME }}" >> ~/.savant/config.properties
echo "packagistAPIToken=${{ env.API_KEY }}" >> ~/.savant/config.properties
- name: release to svn
if: inputs.command == 'release'
shell: bash -l {0}
run: sb release

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

0 comments on commit 424af6e

Please sign in to comment.