-
Notifications
You must be signed in to change notification settings - Fork 11
54 lines (44 loc) · 1.4 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache Maven
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# for deployment, cache step must come BEFORE setup-java else settings.xml gets rewritten by cache
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: tcgone-deploy
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy Project
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: myMavenRepo
MAVEN_PASSWORD: ${{ secrets.REPO_PASSWORD }}
# disabled for token security reasons
# for now, front deployments should be done manually via triggering deploy.yml workflow
# this can be re-enabled after creating a constrained token via a github app
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions
#
# - uses: octokit/[email protected]
# id: trigger_front
# with:
# route: POST /repos/{owner}/{repo}/actions/workflows/{workflow}/dispatches
# owner: tcgone
# repo: front
# workflow: deploy.yml
# ref: master
# env:
# GITHUB_TOKEN: ${{ secrets.GH_PAT }}