-
-
Notifications
You must be signed in to change notification settings - Fork 35
49 lines (43 loc) · 1.57 KB
/
docker-build.yaml
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: Container Processing
on:
push:
branches: [ "master" ]
env:
# Setting an environment variable with the value of a configuration variable
REACT_APP_GOOGLE_ANALYTICS: ${{ vars.REACT_APP_GOOGLE_ANALYTICS}}
REACT_APP_BACKEND_SERVER: ${{ vars.REACT_APP_BACKEND_SERVER}}
REACT_APP_FRONTEND_SERVER: ${{ vars.REACT_APP_FRONTEND_SERVER}}
REACT_APP_ADMIN_SERVER: ${{ vars.REACT_APP_ADMIN_SERVER}}
REACT_APP_ACCOUNT_SERVER: ${{ vars.REACT_APP_ACCOUNT_SERVER}}
REACT_APP_COOKIE_DOMAIN: ${{ vars.REACT_APP_COOKIE_DOMAIN}}
REACT_APP_ADMIN_EMAIL: ${{ vars.REACT_APP_ADMIN_EMAIL}}
REACT_APP_SITE_NAME: ${{ vars.REACT_APP_SITE_NAME}}
STAGE: ${{ vars.STAGE}}
jobs:
push_to_registry:
strategy:
matrix:
service: [account, admin, backend, frontend, mongo, nginx-proxy]
name: Push Docker image to DockerHub
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.service }}
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ vars.DOCKER_NAMESPACE }}/trunk-server-${{ matrix.service }}:latest
build-args: STAGE=${{vars.STAGE}}