Skip to content

Merge pull request #11 from miles-no/feat(web-app)/container-web-app-… #7

Merge pull request #11 from miles-no/feat(web-app)/container-web-app-…

Merge pull request #11 from miles-no/feat(web-app)/container-web-app-… #7

name: Build and Push Docker image to Azure Container Registry
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code from the repository
- name: Checkout code
uses: actions/checkout@v2
# Step 2: Set up Docker Buildx (optional, improves build performance)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Step 3: Log in to Azure Container Registry
- name: Log in to Azure Container Registry
run: echo "${{ secrets.ACR_PASSWORD }}" | docker login "${{ secrets.ACR_SERVER }}" -u "${{ secrets.ACR_USERNAME }}" --password-stdin
# Step 4: Build the Docker image
- name: Build the Docker image
run: docker build -t "${{ secrets.ACR_SERVER }}/aquaapi:latest" ./api/AquaApi
# Step 5: Push the Docker image to Azure Container Registry
- name: Push the Docker image
run: docker push "${{ secrets.ACR_SERVER }}/aquaapi:latest"