Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

use GitHub Actions to build and deploy image #5

use GitHub Actions to build and deploy image

use GitHub Actions to build and deploy image #5

name: Build and Push to ACR
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: 'Build and Push to ACR'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}
username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_SERVER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image to ACR
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/kantega-big-agi:latest
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: 'kantega-big-agi'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images: '${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/kantega-big-agi:latest'