-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.33 KB
/
Copy pathdocker-build.yml
File metadata and controls
51 lines (43 loc) · 1.33 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
name: Build, Test, and Push Docker Images
on:
push:
branches:
- main
jobs:
build-test-push:
runs-on: ubuntu-latest
env:
DOCKER_USER: adenholm
BACKEND_IMAGE: adenholm/heap-recipes-backend
FRONTEND_IMAGE: adenholm/heap-recipes-frontend
SHA_TAG: ${{ github.sha }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push backend (multi-arch)
uses: docker/build-push-action@v6
with:
context: ./server
file: ./server/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.BACKEND_IMAGE }}:latest
${{ env.BACKEND_IMAGE }}:${{ env.SHA_TAG }}
- name: Build and push frontend (multi-arch)
uses: docker/build-push-action@v6
with:
context: ./client
file: ./client/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.FRONTEND_IMAGE }}:latest
${{ env.FRONTEND_IMAGE }}:${{ env.SHA_TAG }}