-
Notifications
You must be signed in to change notification settings - Fork 18
45 lines (39 loc) · 1.21 KB
/
dev-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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}}