Skip to content

deploy prod with azure #7

deploy prod with azure

deploy prod with azure #7

Workflow file for this run

name: Develop CD workflow
on:
workflow_dispatch:
push:
branches:
- develop
env:
IMAGE_NAME: ghcr.io/lemoncode/code-paster:dev-${{github.sha}}-${{github.run_attempt}}
permissions:
contents: 'read'
packages: 'write'
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: 'Development'
url: https://dev-codepaster.azurewebsites.net
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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 docker image
run: |
docker build \
--build-arg BASE_API_URL=https://dev-codepaster.azurewebsites.net \
--build-arg BASE_SOCKET_URL=https://dev-codepaster.azurewebsites.net \
-t ${{env.IMAGE_NAME}} .
docker push ${{env.IMAGE_NAME}}
- name: Deploy to Azure
uses: azure/webapps-deploy@v3
with:
app-name: ${{ secrets.DEV_AZURE_APP_NAME }}
publish-profile: ${{ secrets.DEV_AZURE_PUBLISH_PROFILE }}
images: ${{env.IMAGE_NAME}}