-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.87 KB
/
build-and-push-docker-image.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
name: Build and push docker image
on: [push]
env:
DOCKER_REPO: ${{ secrets.DOCKER_USERNAME }}/hawk-garage
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Make stage envfile
if: endsWith(github.ref, '/stage')
uses: SpicyPizza/create-envfile@v1
with:
envkey_VUE_APP_HAWK_TOKEN: ${{ secrets.HAWK_TOKEN_STAGE }}
envkey_VUE_APP_AMPLITUDE_TOKEN: ${{ secrets.AMPLITUDE_TOKEN_STAGE }}
envkey_VUE_APP_CLOUDPAYMENTS_PUBLIC_ID: ${{ secrets.CP_PUBLIC_ID_STAGE }}
envkey_VUE_APP_API_ENDPOINT: "https://api.stage.hawk.so"
- name: Make prod envfile
if: endsWith(github.ref, '/prod')
uses: SpicyPizza/create-envfile@v1
with:
envkey_VUE_APP_HAWK_TOKEN: ${{ secrets.HAWK_TOKEN_PROD }}
envkey_VUE_APP_AMPLITUDE_TOKEN: ${{ secrets.AMPLITUDE_TOKEN_PROD }}
envkey_VUE_APP_CLOUDPAYMENTS_PUBLIC_ID: ${{ secrets.CP_PUBLIC_ID_PROD }}
envkey_VUE_APP_API_ENDPOINT: "https://api.hawk.so"
- name: Make prod envfile
if: endsWith(github.ref, '/prod-ru')
uses: SpicyPizza/create-envfile@v1
with:
envkey_VUE_APP_HAWK_TOKEN: ${{ secrets.HAWK_TOKEN_PROD }}
envkey_VUE_APP_AMPLITUDE_TOKEN: ${{ secrets.AMPLITUDE_TOKEN_PROD }}
envkey_VUE_APP_CLOUDPAYMENTS_PUBLIC_ID: ${{ secrets.CP_PUBLIC_ID_PROD }}
envkey_VUE_APP_API_ENDPOINT: "https://api.hawk-tracker.ru"
- name: Build and push docker image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ env.DOCKER_REPO }}
tag_with_ref: true
push: ${{ endsWith(github.ref, '/stage') || endsWith(github.ref, '/prod') || endsWith(github.ref, '/prod-ru') }}