Skip to content

Update build-image-06242024.yml #2

Update build-image-06242024.yml

Update build-image-06242024.yml #2

name: Build and push the latest build to ACR
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build_push_image:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Checkout code
uses: actions/checkout@v2
- name: Print ACR_NAME
run: echo "ACR_NAME=${{ secrets.ACR_NAME }}"
- name: Print ACR_LOGIN
run: echo "ACR_LOGIN=${{ secrets.ACR_LOGIN }}"
- name: Print ACR_PASSWORD
run: echo "ACR_PASSWORD=${{ secrets.ACR_PASSWORD }}"
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ${{ secrets.ACR_NAME }}
username: ${{ secrets.ACR_LOGIN }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push staging images
uses: docker/[email protected]
with:
context: .
tags: ${{secrets.ACR_NAME}}/ratings-web:latest
push: true