Created
February 3, 2023 02:36
-
-
Save ImIOImI/5a8eaf97242ba054c2ea1e2a08fd5cbb to your computer and use it in GitHub Desktop.
On Merge Tag and Build and Push Image to ACR
This file contains hidden or 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
name: Build a Docker image and Push it to ACR | |
on: | |
push: | |
branches: [ main ] | |
schedule: | |
- cron: 0 11 * * 1 | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- | |
id: release | |
name: Determine the Release Semantic Version | |
uses: rymndhng/release-on-push-action@master | |
with: | |
bump_version_scheme: minor | |
- | |
name: Check Output Parameters | |
run: | | |
echo "Got tag name ${{ steps.release.outputs.tag_name }}" | |
echo "Got release version ${{ steps.release.outputs.version }}" | |
echo "release_version=${{ steps.release.outputs.version }}" >> $GITHUB_ENV | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
registry: <replaceme>.azurecr.io | |
username: ${{ secrets.SERVICE_PRINCIPAL_ID }} | |
password: ${{ secrets.SERVICE_PRINCIPAL_PASSWORD }} | |
- | |
name: Build and Push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
tags: | |
<replaceme>.azurecr.io:${{ env.release_version }} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment