-
Notifications
You must be signed in to change notification settings - Fork 3
111 lines (93 loc) · 3.2 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Deploy CI
on:
push:
branches:
- main
release:
types: published
jobs:
assembly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build artifact
run: sbt assembly
- name: Upload output jar
uses: actions/upload-artifact@v2
with:
name: jar
path: target/scala-2.12/metabolic-core-assembly-SNAPSHOT.jar
- name: Upload output entrypoint
uses: actions/upload-artifact@v2
with:
name: em_entrypoint
path: src/main/scala/MapperEntrypoint.scala
deploy-latest:
needs: assembly
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Download em_entrypoint
uses: actions/download-artifact@v2
with:
name: em_entrypoint
- name: Upload EM Entrypoint file to S3
uses: a-sync/s3-uploader@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-central-1'
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
S3_KEY: platform/core/latest/MapperEntrypoint.scala
FILE: ./MapperEntrypoint.scala
- name: Download jar
uses: actions/download-artifact@v2
with:
name: jar
- name: Upload jar artifact file to S3
uses: a-sync/s3-uploader@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-central-1'
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
S3_KEY: platform/core/latest/metabolic-core-assembly.jar
FILE: ./metabolic-core-assembly-SNAPSHOT.jar
deploy-release:
needs: assembly
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- name: Git branch name
uses: EthanSK/git-branch-name-action@v1
- name: Download em_entrypoint
uses: actions/download-artifact@v2
with:
name: em_entrypoint
- name: Upload EM Entrypoint file to S3
uses: a-sync/s3-uploader@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-central-1'
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
S3_KEY: ${{ format('platform/core/{0}/MapperEntrypoint.scala', env.GIT_BRANCH_NAME) }}
FILE: ./MapperEntrypoint.scala
- name: Download jar
uses: actions/download-artifact@v2
with:
name: jar
- name: Upload jar artifact file to S3
uses: a-sync/s3-uploader@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-central-1'
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
S3_KEY: ${{ format('platform/core/{0}/metabolic-core-assembly.jar', env.GIT_BRANCH_NAME) }}
FILE: ./metabolic-core-assembly-SNAPSHOT.jar