-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (47 loc) · 1.45 KB
/
docker.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
54
name: Docker Build
on:
push:
branches: [develop]
tags: [v*]
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_PREFIX: ghcr.io/ryanconnell/tracker
DOCKER_PLATFORM: linux/amd64,linux/arm64
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}
# Create tags for different components
- uses: crazy-max/ghaction-docker-meta@v1
id: docker_meta_frontend
with:
images: ${{ env.DOCKER_IMAGE_PREFIX}}-frontend
tag-sha: true
- uses: crazy-max/ghaction-docker-meta@v1
id: docker_meta_backend
with:
images: ${{ env.DOCKER_IMAGE_PREFIX}}-backend
tag-sha: true
- uses: docker/build-push-action@v2
with:
file: cmd/frontend/Dockerfile
platforms: ${{ env.DOCKER_PLATFORM }}
push: true
tags: ${{ steps.docker_meta_frontend.outputs.tags }}
labels: ${{ steps.docker_meta_frontend.outputs.labels }}
- name: Build and Push Backend
uses: docker/build-push-action@v2
with:
file: cmd/frontend/Dockerfile
platforms: ${{ env.DOCKER_PLATFORM }}
push: true
tags: ${{ steps.docker_meta_backend.outputs.tags }}
labels: ${{ steps.docker_meta_backend.outputs.labels }}