-
Notifications
You must be signed in to change notification settings - Fork 50
40 lines (36 loc) · 1.08 KB
/
publish-icr.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
name: Publish container image
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- 'images/**'
- slackbot-openapi-spec.json
jobs:
publish_to_registry:
name: Build and push image to registry
runs-on: ubuntu-latest
env:
ICR_NAMESPACE: solution-tutorials
ICR_REPOSITORY: tutorial-slack-chatbot-database
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Container Registry
uses: docker/[email protected]
with:
registry: icr.io
username: ${{ secrets.ICR_USER }}
password: ${{ secrets.ICR_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: icr.io/${{ env.ICR_NAMESPACE }}/${{ env.ICR_REPOSITORY }}
- name: Build and push image
uses: docker/build-push-action@v2
with:
push: true
tags: icr.io/${{ env.ICR_NAMESPACE }}/${{ env.ICR_REPOSITORY }}:latest
labels: ${{ steps.meta.outputs.labels }}