-
Notifications
You must be signed in to change notification settings - Fork 21
115 lines (100 loc) · 3.35 KB
/
deploy-release.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
112
113
114
115
name: Deploy Release
on:
release:
types:
- released
env:
RUMPEL: live
RUMPEL_ALT: latest
RUMPEL_BUCKET: hubofallthings-net-frontend-build-artifacts
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Cache - GHA
uses: actions/cache@v2
with:
path: ~/.cache/coursier/v1/https
key: ${{ runner.OS }}-coursier-cache
- name: Cache - Resolvers
run: curl https://${{ secrets.ARTIFACTS_CACHE_BUCKET }}/resolvers.sbt --create-dirs -o ~/.sbt/resolvers.sbt
- name: Setup Java
uses: actions/[email protected]
with:
distribution: adopt
java-version: 11
java-package: jdk
architecture: x64
- name: App - Frontend
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYER_MASTER_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYER_MASTER_SECRET_ACCESS_KEY }}
run: |
cd ./hat/app/org/hatdex/hat/phata/assets/
aws s3 cp s3://${{ env.RUMPEL_BUCKET }}/${{ env.RUMPEL }} rumpel --recursive --region eu-west-1
aws s3 cp s3://${{ env.RUMPEL_BUCKET }}/${{ env.RUMPEL_ALT }} alt-rumpel --recursive --region eu-west-1
cp rumpel/*.js* js/
cp rumpel/*.css stylesheets/
gzip --keep --force js/*.bundle.js
cp -r rumpel/assets/* .
cp -r alt-rumpel/* .
rm -r rumpel
rm -r alt-rumpel
cd -
- name: App - Build
run: sbt Docker/stage
- name: Container - Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Container - Setup Buildx
uses: docker/setup-buildx-action@v1
- name: Container - Login DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_DATASWIFT_USER }}
password: ${{ secrets.DOCKERHUB_DATASWIFT_PASS }}
- name: Container - Login GitHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.BOT_GITHUB_NAME }}
password: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Container - Meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
dataswift/hat
ghcr.io/dataswift/hat
tags: |
type=raw,value=latest
type=semver,prefix=v,pattern={{version}}
type=semver,prefix=v,pattern={{major}}
type=semver,prefix=v,pattern={{major}}.{{minor}}
- name: Container - Build & Push
uses: docker/build-push-action@v2
with:
push: true
context: hat/target/docker/stage
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/datasiwft/hat:latest
- name: Slack
uses: lazy-actions/slatify@master
if: failure()
with:
type: ${{ job.status }}
job_name: "*${{ env.GITHUB_WORKFLOW }}*"
channel: "ci"
commit: true
mention: "here"
mention_if: "failure"
token: ${{ secrets.GITHUB_TOKEN }}
url: ${{ secrets.SLACK_WEBHOOK_URL }}