Skip to content

edit: azure yml file #11

edit: azure yml file

edit: azure yml file #11

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Build and deploy a container to an Azure Web App
env:
AZURE_WEBAPP_NAME: demo-docker-app-clue # set this to your application's name
on:
push:
branches:
- main
permissions:
contents: "read"
packages: "write"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v3
- name: "Log in to GitHub container registry"
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image to registry
uses: docker/build-push-action@v5.1.0
with:
push: true
tags: ghcr.io/clue355/image:dev
file: ./Dockerfile.dev
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: "production"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: "Login via Azure CLI"
uses: Azure/login@v1.6.1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: "Deploy to Azure Web App"
id: deploy-to-webapp
uses: Azure/webapps-deploy@v3.0.0
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images: "ghcr.io/clue355/image:dev"