-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (40 loc) · 1.42 KB
/
ci_production.yml
File metadata and controls
52 lines (40 loc) · 1.42 KB
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
name: CI Production
on:
push:
tags:
- '*'
permissions:
contents: read
env:
API_IMAGE: email/api
APP_IMAGE: email/app
TAG: latest
REGISTRY: ${{ secrets.REGISTRY_NAME }}
jobs:
deploy_production:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
ref: ${{ github.ref }}
- name: Pull changes from branch
env:
GIT_REF: ${{ github.ref }}
run: git pull origin "$GIT_REF"
- name: create app/.env file
run: |
echo "VITE_API_URL=${{ secrets.PROD_VITE_API_URL }}" >> app/.env
echo "VITE_DOMAINS=${{ secrets.PROD_VITE_DOMAINS }}" >> app/.env
echo "VITE_APP_NAME=${{ secrets.PROD_VITE_APP_NAME }}" >> app/.env
echo "VITE_RESYNC_URL=${{ secrets.PROD_VITE_RESYNC_URL }}" >> app/.env
- name: Build api image
run: docker build -t $REGISTRY/$API_IMAGE:$TAG api/.
- name: Build app image
run: docker build -t $REGISTRY/$APP_IMAGE:$TAG app/.
- name: Log in to registry
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ secrets.REGISTRY_NAME }} -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
- name: Push api:${{ env.TAG }}
run: docker push $REGISTRY/$API_IMAGE:$TAG
- name: Push app:${{ env.TAG }}
run: docker push $REGISTRY/$APP_IMAGE:$TAG