Skip to content

Commit 982fddd

Browse files
authored
Merge pull request #2874 from microsoftgraph/bugfix/docker-outdated
fix: adds workflow to publish docker image
2 parents f7dae28 + de7676f commit 982fddd

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/docker.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish Docker image
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags: ["*"]
6+
env:
7+
REGISTRY: msgraphprod.azurecr.io
8+
IMAGE_NAME: public/microsoftgraph/powershell
9+
jobs:
10+
push_to_registry:
11+
environment:
12+
name: acr
13+
name: Push Docker image
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v4
18+
- name: Login to GitHub package feed
19+
uses: docker/login-action@v3.3.0
20+
with:
21+
username: ${{ secrets.ACR_USERNAME }}
22+
password: ${{ secrets.ACR_PASSWORD }}
23+
registry: ${{ env.REGISTRY }}
24+
25+
- name: Get truncated run number
26+
id: getversion
27+
run: |
28+
$version = $Env:GITHUB_REF.replace("refs/tags/", "")
29+
Write-Output "version=$version" >> $Env:GITHUB_OUTPUT
30+
shell: pwsh
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v3
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
- name: Push to GitHub Packages - Release
36+
uses: docker/build-push-action@v6.5.0
37+
with:
38+
push: true
39+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
40+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}
41+
build-args: |
42+
VERSION=${{ steps.getversion.outputs.version }}

0 commit comments

Comments
 (0)