Update main action for ACR #3
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
name: Push Docker Image to ACR on Merge to Main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Get current date | |
run: echo "CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Login to Azure Container Registry | |
uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.ACR_ENDPOINT }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
- name: Push Docker image to ACR | |
run: | | |
docker buildx create --use | |
docker buildx inspect | |
docker push ${{ secrets.ACR_ENDPOINT }}/next-hello-world:${CURRENT_DATE} . |