forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 7
82 lines (72 loc) · 2.32 KB
/
dev-release.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: "Build and Publish"
on:
push:
branches:
- 'main'
- 'daocloud'
pull_request:
branches:
- 'main'
- 'daocloud'
jobs:
build_and_push_images_v2:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
RELEASE_VERSION: "${{ github.event.release.tag_name }}"
DOCKERHUB_REPO: "openinsight-proj/demo"
GHCR_REPO: "ghcr.io/openinsight-proj/demo"
strategy:
matrix:
file_tag:
- file: ./src/adservice-v2/Dockerfile
tag_suffix: adservice-v2
context: ./
- file: ./src/dataservice/Dockerfile
tag_suffix: dataservice
context: ./
- file: ./src/checkoutservice-v2/Dockerfile
tag_suffix: checkoutservice-v2
context: ./
- file: ./src/spring-cloud-gateway/Dockerfile
tag_suffix: spring-cloud-gateway
context: ./
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.ACTIONS_TOKEN }}
if: github.event_name != 'pull_request'
# - name: Log in to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# if: github.event_name != 'pull_request'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[worker.oci]
max-parallelism = 2
- name: Matrix Build and push demo images
uses: docker/[email protected]
with:
context: ${{ matrix.file_tag.context }}
file: ${{ matrix.file_tag.file }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_REPO }}:${{ github.sha }}-${{ matrix.file_tag.tag_suffix }}
${{ env.GHCR_REPO }}:${{ env.RELEASE_VERSION || 'pr' }}-${{ matrix.file_tag.tag_suffix }}
cache-from: type=gha
cache-to: type=gha