-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpublish-container-image-icr-validate.yml
More file actions
71 lines (62 loc) · 2.31 KB
/
publish-container-image-icr-validate.yml
File metadata and controls
71 lines (62 loc) · 2.31 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Publish container image Manual Validator
on:
push:
branches:
- master
jobs:
publish_to_registry:
name: Build and push image to registry
runs-on: ubuntu-latest
env:
ICR_NAMESPACE: solution-tutorials
ICR_REPOSITORY_FRONTEND: tutorial-text-analysis-code-engine-frontend
ICR_REPOSITORY_BACKEND: tutorial-text-analysis-code-engine-backend
ICR_REPOSITORY_BACKEND_JOB: tutorial-text-analysis-code-engine-backend-job
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: icr.io
username: ${{ secrets.ICR_USER }}
password: ${{ secrets.ICR_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta-frontend
uses: docker/metadata-action@v5
with:
images: icr.io/${{ env.ICR_NAMESPACE }}/${{ env.ICR_REPOSITORY_FRONTEND }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: ${{ steps.meta-frontend.outputs.tags }}
labels: ${{ steps.meta-frontend.outputs.labels }}
- name: Extract metadata (tags, labels) for Docker
id: meta-backend
uses: docker/metadata-action@v5
with:
images: icr.io/${{ env.ICR_NAMESPACE }}/${{ env.ICR_REPOSITORY_BACKEND }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}
- name: Extract metadata (tags, labels) for Docker
id: meta-backend-job
uses: docker/metadata-action@v5
with:
images: icr.io/${{ env.ICR_NAMESPACE }}/${{ env.ICR_REPOSITORY_BACKEND_JOB }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: ./jobs
file: ./jobs/Dockerfile
push: true
tags: ${{ steps.meta-backend-job.outputs.tags }}
labels: ${{ steps.meta-backend-job.outputs.labels }}