-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (44 loc) · 1.53 KB
/
image-push-stage.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
name: Build and Push Multiple Docker Images
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
build-and-push:
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == true ||
github.event.action == 'opened' ||
github.event.action == 'synchronize' ||
github.event.action == 'reopened'
strategy:
matrix:
include:
- dockerfile: admin.k8s.Dockerfile
image_name: nutfes/group-manager-2-admin-view
- dockerfile: front.k8s.Dockerfile
image_name: nutfes/group-manager-2-user-front
- dockerfile: api.k8s.Dockerfile
image_name: nutfes/group-manager-2-api
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ matrix.image_name }}:latest
build-args: |
API_URL=${{ secrets.VUE_APP_URL }}
APP_API_URL=${{ secrets.VUE_APP_API_URL }}
CLIENT_ID=${{ secrets.NUXT_IMGUR_CLIENT_ID }}
CLIENT_SECRET=${{ secrets.NUXT_IMGUR_CLIENT_SECRET }}