Skip to content

Instantly share code, notes, and snippets.

@oismaelash
Last active December 20, 2024 17:42
Show Gist options
  • Select an option

  • Save oismaelash/9a39db840039ed0cdc99e4c0a236eb15 to your computer and use it in GitHub Desktop.

Select an option

Save oismaelash/9a39db840039ed0cdc99e4c0a236eb15 to your computer and use it in GitHub Desktop.
name: Build and Push to ACR
on:
push:
branches:
- '*'
env:
LOGIN_SERVER: ${{ secrets.LOGIN_SERVER }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
TAG: latest
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: azure/docker-login@v2
with:
login-server: ${{ env.LOGIN_SERVER }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- run: |
docker build . -t ${{ env.LOGIN_SERVER }}/<PROJECT_NAME>:${{ env.TAG }}
docker push ${{ env.LOGIN_SERVER }}/<PROJECT_NAME>:${{ env.TAG }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment