forked from coral-xyz/backpack
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 2.72 KB
/
notifications-worker.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
name: Deploy notifications-worker
on:
push:
branches:
- production
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: "mv docker/notifications-worker/Dockerfile ."
- name: add secrets
env:
DOCKER_USER: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
cd backend/native/notifications-worker
touch .env
printf 'NODE_ENV=production\n' >> .env
printf 'AUTH_JWT=%s\n' '${{secrets.AUTH_JWT}}' >> .env
printf 'AUTH_JWT_PRIVATE_KEY=%s\n' '${{secrets.AUTH_JWT_PRIVATE_KEY}}' >> .env
printf 'AUTH_JWT_PUBLIC_KEY=%s\n' '${{secrets.AUTH_JWT_PUBLIC_KEY}}' >> .env
printf 'AWS_S3_KEY_ID=%s\n' '${{secrets.AWS_S3_KEY_ID}}' >> .env
printf 'AWS_S3_KEY_SECRET=%s\n' '${{secrets.AWS_S3_KEY_SECRET}}' >> .env
printf 'AUTH_HASURA_URL=%s\n' '${{secrets.HASURA_URL}}' >> .env
printf 'CHAT_HASURA_URL=%s\n' '${{secrets.CHAT_HASURA_URL}}' >> .env
printf 'REDIS_URL=%s\n' '${{secrets.REDIS_URL}}' >> .env
printf 'CHAT_JWT=%s\n' '${{secrets.CHAT_JWT}}' >> .env
printf 'HELIUS_API_KEY=%s\n' '${{secrets.HELIUS_API_KEY}}' >> .env
printf 'VAPID_PRIVATE_KEY=%s\n' '${{secrets.VAPID_PRIVATE_KEY}}' >> .env
printf 'VAPID_PUBLIC_KEY=%s\n' '${{secrets.VAPID_PUBLIC_KEY}}' >> .env
cd ../../..
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build the Docker image
run: docker build . --tag backpackapp/notifications-worker:${{ github.sha }}-nw
- name: Docker Push
run: docker push backpackapp/notifications-worker:${{ github.sha }}-nw
- name: Create zip
run: "mkdir deploy && cp ./docker/notifications-worker/docker-compose.yml ./deploy && cp ./docker/Dockerrun.aws.json ./deploy && sed -e 's/{{tag}}/${{ github.sha }}-nw/g' -e 's/{{NRIA_LICENSE_KEY}}/${{ secrets.NRIA_LICENSE_KEY }}/g' ./deploy/docker-compose.yml > ./deploy/temp.yml && mv ./deploy/temp.yml ./deploy/docker-compose.yml && cd deploy && zip deploy.zip * && cd .. && mv ./deploy/deploy.zip ."
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_EB_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_EB_SECRET_ACCESS_KEY }}
application_name: backend-api
environment_name: notifications-worker-dockerhub
version_label: ${{ github.sha }}-nw
region: us-west-1
deployment_package: deploy.zip