-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (62 loc) · 1.97 KB
/
ci-cd-develop.yml
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
name: 'CI/CD'
on:
push:
jobs:
check:
runs-on: ubuntu-latest
container:
image: debian:bullseye-slim # use the same image as our docker runner
steps:
- name: Clone repo (shallow)
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set up GAMS
shell: bash # required for the source command
env:
GAMS_LICENSE: ${{ secrets.GAMS_LICENSE }}
run: |
source ./scripts/setup-gams.sh
echo "/opt/conda/bin" >> "$GITHUB_PATH"
echo "$GAMS_PATH" >> "$GITHUB_PATH"
echo "GMSPYTHONLIB=/opt/conda/envs/gams/lib/libpython3.10.so" >> "$GITHUB_ENV"
- name: Install solver dependencies
run: ./scripts/ci-setup-solvers.sh
- name: Run checks
shell: bash # required for the source command
run: |
source /opt/conda/bin/activate gams
./gradlew check --info
- name: Archive test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: test-report
path: build/reports/tests/test/
- name: Archive style reports
if: always()
uses: actions/upload-artifact@v3
with:
name: style-report
path: build/reports/checkstyle/
deploy-staging:
runs-on: ubuntu-latest
needs: check
if: ${{ github.ref == 'refs/heads/develop' }}
steps:
- name: Clone repo (shallow)
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Push to dokku
uses: dokku/github-action@master
with:
branch: develop
# only extracting the server address to a secret avoids leaking it in the logs
git_remote_url: ssh://dokku@${{ secrets.DOKKU_SERVER_ADDRESS }}/toolbox-backend-staging
ssh_private_key: ${{ secrets.DOKKU_DEPLOYMENT_KEY }}