-
Notifications
You must be signed in to change notification settings - Fork 351
57 lines (53 loc) · 1.77 KB
/
deploy_backend.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
name: deploy_backend
on:
push:
tags:
- "v*.*.*"
jobs:
get-tag:
runs-on: ubuntu-latest
outputs:
GITHUB_TAG: ${{ steps.vars.outputs.GITHUB_TAG }}
steps:
- uses: actions/checkout@master
- name: Set GITHUB_TAG arg
id: vars
run: echo ::set-output name=GITHUB_TAG::${GITHUB_REF:10} # Remove /refs/head/
docker-publish:
runs-on: ubuntu-latest
needs: get-tag
steps:
- uses: actions/checkout@master
- name: Print version
run: echo "Publishing reacherhq/backend:${{ needs.get-tag.outputs.GITHUB_TAG }}"
- name: Publish to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: reacherhq/backend
dockerfile: backend/Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "${{ needs.get-tag.outputs.GITHUB_TAG }},beta"
ecr-publish:
runs-on: ubuntu-latest
needs: get-tag
steps:
- uses: actions/checkout@master
- name: Print version
run: echo "Publishing reacherhq/backend:${{ needs.get-tag.outputs.GITHUB_TAG }}"
- name: Login to ECR
id: ecr
uses: elgohr/ecr-login-action@v3
with:
access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
region: ${{ secrets.AWS_REGION }}
- name: Publish to AWS ECR
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: reacherhq/sqs
dockerfile: sqs/Dockerfile
username: ${{ steps.ecr.outputs.username }}
password: ${{ steps.ecr.outputs.password }}
registry: ${{ steps.ecr.outputs.registry }}
tags: "${{ needs.get-tag.outputs.GITHUB_TAG }},beta"