-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2874 from microsoftgraph/bugfix/docker-outdated
fix: adds workflow to publish docker image
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Publish Docker image | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: ["*"] | ||
env: | ||
REGISTRY: msgraphprod.azurecr.io | ||
IMAGE_NAME: public/microsoftgraph/powershell | ||
jobs: | ||
push_to_registry: | ||
environment: | ||
name: acr | ||
name: Push Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Login to GitHub package feed | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.ACR_USERNAME }} | ||
password: ${{ secrets.ACR_PASSWORD }} | ||
registry: ${{ env.REGISTRY }} | ||
|
||
- name: Get truncated run number | ||
id: getversion | ||
run: | | ||
$version = $Env:GITHUB_REF.replace("refs/tags/", "") | ||
Write-Output "version=$version" >> $Env:GITHUB_OUTPUT | ||
shell: pwsh | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Push to GitHub Packages - Release | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }} | ||
build-args: | | ||
VERSION=${{ steps.getversion.outputs.version }} |