-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.4 KB
/
test-build-frontend-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
name: Test Build Frontend Docker Image
on:
pull_request:
branches:
- main
- beta
- dev
paths:
- "apps/frontend/**"
workflow_dispatch:
jobs:
test_build_image:
name: Test Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Check out the repository
uses: actions/checkout@v3
- name: Set env
id: setenv
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo "::set-output name=backend_base_url::${{ secrets.MAIN_BACKEND_BASE_URL }}"
elif [ "${{ github.ref_name }}" = "beta" ]; then
echo "::set-output name=backend_base_url::${{ secrets.BETA_BACKEND_BASE_URL }}"
elif [ "${{ github.ref_name }}" = "dev" ]; then
echo "::set-output name=backend_base_url::${{ secrets.DEV_BACKEND_BASE_URL }}"
fi
- name: Test Build Docker Image
uses: docker/build-push-action@v4
with:
context: .
build-args: |
BACKEND_BASE_URL=${{ steps.setenv.outputs.backend_base_url }}
FRONTEND_OMISE_PUBLIC_KEY=${{ secrets.FRONTEND_OMISE_PUBLIC_KEY }}
file: Dockerfile.frontend
push: false
cache-from: type=gha
cache-to: type=gha,mode=max