Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #45 from Azure/dev-#34
Browse files Browse the repository at this point in the history
Dev #34
  • Loading branch information
michaelsrichter authored Oct 12, 2021
2 parents 65291c1 + 736861f commit a782cd7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bin\
obj\
bin/
obj/
79 changes: 40 additions & 39 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
name: Docker Build and Push
name: Publish Docker image

on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
- dev

# Publish `v1.2.3` tags as releases.
tags:
- v*

# Run tests for any PRs.
pull_request:

env:
IMAGE_NAME: easyauthfork8s/msal-net-proxy-opt
release:
types: [published]

jobs:
# Push image to GitHub Package Registry.
# See also https://docs.docker.com/docker-hub/builds/
push:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
if: github.event_name == 'push'

permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file Dockerfile --tag image

- name: docker hub login
run: |
docker login -u ${{ secrets.DOCKER_USER_ID }} -p ${{ secrets.DOCKER_REGISTRY_PASS }}
- name: publish docker image
run: |
IMAGE_ID=$IMAGE_NAME
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USER_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASS }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
ghcr.io/${{ github.repository }}/msal-net-proxy-opt
easyauthfork8s/msal-net-proxy-opt
- name: Build and push Docker images
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit a782cd7

Please sign in to comment.