-
Notifications
You must be signed in to change notification settings - Fork 31
72 lines (64 loc) · 1.95 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# 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:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
command:
type: choice
options:
- test # build only
- release # build & release to svn
default: build
permissions:
contents: read
jobs:
test:
if: |
github.event_name == 'pull_request' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' && inputs.command == 'test'
runs-on: fusionauth-standard
steps:
- name: checkout
uses: actions/checkout@v4
- name: Test that we can compile
shell: bash -l {0}
run: sb compile
- name: Copy our kickstart file over so it gets picked up
run: |
mkdir faDockerComposeFilePath
cp -r .github/kickstart faDockerComposeFilePath
cp .github/kickstart/kickstart.json faDockerComposeFilePath/kickstart/k2.json
cp .github/kickstart/kickstart.json .github/kickstart/k2.json
- name: Start FusionAuth
uses: fusionauth/fusionauth-github-action@v1
with:
FUSIONAUTH_APP_KICKSTART_FILENAME: k2.json
FUSIONAUTH_APP_KICKSTART_DIRECTORY_PATH: .github/kickstart
- name: Sleep until FusionAuth starts
run: sleep 30
- name: Run tests
shell: bash -l {0}
run: sb test
deploy:
if: |
github.event_name == 'workflow_dispatch' && inputs.command == 'release'
runs-on: fusionauth-builder
steps:
- name: checkout
uses: actions/checkout@v4
- name: release to svn
if: inputs.command == 'release'
shell: bash -l {0}
run: sb release