forked from microsoft/kiota
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.75 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
name: Publish Docker image
on:
workflow_dispatch:
push:
branches: [main]
tags: ['v*']
paths: ['src/**', '.github/workflows/**']
env:
REGISTRY: msgraphprod.azurecr.io
IMAGE_NAME: public/openapi/kiota
jobs:
push_to_registry:
environment:
name: acr
name: Push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Login to GitHub package feed
uses: docker/[email protected]
with:
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
registry: ${{ env.REGISTRY }}
- run: |
$version = $Env:BRANCH_NAME -replace "refs/tags/v",""
echo "::set-output name=version::${version}"
shell: pwsh
id: getversion
if: contains(github.ref, 'refs/tags/v')
env:
BRANCH_NAME: ${{ github.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Push to GitHub Packages - Nightly
if: contains(github.ref, 'refs/head/main')
uses: docker/[email protected]
with:
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,windows/amd64
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
- name: Push to GitHub Packages - Release
if: contains(github.ref, 'refs/tags/v')
uses: docker/[email protected]
with:
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,windows/amd64
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}