Skip to content

Commit 23ad122

Browse files
committed
Merge branch 'continuous-deployment-to-azure'
2 parents 82b1e6c + 7739fea commit 23ad122

19 files changed

+233
-97
lines changed

.github/workflows/ci-pipeline.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,43 @@ jobs:
2020
run: docker build --target test --tag backend:test ./backend
2121
- name: Run tests
2222
run: docker run --env-file backend/.env.test backend:test
23+
24+
publish:
25+
name: Publish To Docker
26+
runs-on: ubuntu-latest
27+
needs: build
28+
if: ${{ (github.ref == 'refs/heads/main') && (github.event_name == 'push') }}
29+
steps:
30+
- name: Checkout Repository
31+
uses: actions/checkout@v4
32+
- name: Login to Docker Hub
33+
uses: docker/login-action@v3
34+
with:
35+
username: ${{ secrets.DOCKER_USERNAME }}
36+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
37+
38+
- name: Build frontend Docker image
39+
working-directory: frontend
40+
run: docker build --target production --tag calpin/playlist-manager-frontend:prod .
41+
- name: Push frontend Docker image
42+
working-directory: frontend
43+
run: docker push calpin/playlist-manager-frontend:prod
44+
45+
- name: Build backend Docker image
46+
working-directory: backend
47+
run: docker build --target production --tag calpin/playlist-manager-backend:prod .
48+
- name: Push backend Docker image
49+
working-directory: backend
50+
run: docker push calpin/playlist-manager-backend:prod
51+
52+
deploy:
53+
name: Deploy to Azure
54+
runs-on: ubuntu-latest
55+
needs: publish
56+
if: ${{ (github.ref == 'refs/heads/main') && (github.event_name == 'push') }}
57+
steps:
58+
- name: Trigger Azure frontend deployment webhook
59+
run: curl -dH -X POST '${{ secrets.AZURE_DEPLOYMENT_WEBHOOK_FRONTEND }}'
60+
- name: Trigger Azure backend deployment webhook
61+
run: curl -dH -X POST '${{ secrets.AZURE_DEPLOYMENT_WEBHOOK_BACKEND }}'
62+

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Install [Docker](https://www.docker.com/products/docker-desktop/) (Windows insta
3030

3131
From the project root run `docker compose up`
3232

33-
From the frontend directory, build the backend in development mode with `docker build --target development --tag backend:dev .`
33+
From the frontend directory, build the frontend in development mode with `docker build --target development --tag frontend:dev .`
3434

35-
From the backend directory, build the frontend in development mode with `docker build --target development --tag frontend:dev .`
35+
From the backend directory, build the backend in development mode with `docker build --target development --tag backend:dev .`
3636

3737
Build backend tests docker image with `docker build --target test --tag backend:test ./backend/`
3838

@@ -76,5 +76,5 @@ The frontend and backend applications are deployed to two Azure Web Applications
7676
1. Building new Docker images with (from the relevant frontend/backend directory) `docker build --target production --tag calpin/playlist-manager-"frontend/backend":prod .`
7777
2. Pushing the new image to Docker Hub `docker push calpin/playlist-manager-"frontend/backend":prod`
7878
3. Sending a curl request to the appropriate Webhook url:
79-
- Frontend: `curl -dH -X POST "https://\$PlayMan:d17p8pbD0t6xpCdep4tPdetcbsTlZiomZ6kwAwuJB9XaXwjE5hmmgSpBTYqQ@playman.scm.azurewebsites.net/api/registry/webhook"`
80-
- Backend: `curl -dH -X POST "https://\$PlayManBackend:aBPc2NHMrYLEHQtmPB1JhQKgtsonxezPjliwxptyx2142STiv91aRxmnmKe6@playmanbackend.scm.azurewebsites.net/api/registry/webhook"`
79+
- Frontend: `curl -dH -X POST "Frontend Webhook from Azure"`
80+
- Backend: `curl -dH -X POST "Backend Webhook from Azure"`

backend/poetry.lock

Lines changed: 104 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
build:
55
context: frontend
66
dockerfile: Dockerfile
7-
target: development
7+
target: production
88
ports:
99
- "8080:8080"
1010
env_file:
@@ -21,7 +21,7 @@ services:
2121
build:
2222
context: backend
2323
dockerfile: Dockerfile
24-
target: development
24+
target: production
2525
ports:
2626
- "5000:5000"
2727
env_file:
4.32 KB
Loading
14 KB
Loading
4.09 KB
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/images/favicon/mstile-150x150.png"/>
6+
<TileColor>#da532c</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>
587 Bytes
Loading
903 Bytes
Loading

0 commit comments

Comments
 (0)