-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 2.31 KB
/
deploy.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and Push Docker Images
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push frontend images
- name: Build and push frontend Docker images
run: |
cd ./frontend/
docker-compose build
docker tag dps_training_k-frontend ghcr.io/hpi-sam/dps_training_k-frontend:latest
docker push ghcr.io/hpi-sam/dps_training_k-frontend:latest
# Build and push backend images
- name: Build and push backend Docker images
run: |
cd ./backend/dps_training_k/
docker-compose build
docker tag dps_training_k-django ghcr.io/hpi-sam/dps_training_k-django:latest
docker push ghcr.io/hpi-sam/dps_training_k-django:latest
docker tag dps_training_k-celeryworker ghcr.io/hpi-sam/dps_training_k-celeryworker:latest
docker push ghcr.io/hpi-sam/dps_training_k-celeryworker:latest
docker tag dps_training_k-celerybeat ghcr.io/hpi-sam/dps_training_k-celerybeat:latest
docker push ghcr.io/hpi-sam/dps_training_k-celerybeat:latest
docker tag dps_training_k-nginx ghcr.io/hpi-sam/dps_training_k-nginx:latest
docker push ghcr.io/hpi-sam/dps_training_k-nginx:latest
docker tag dps_training_k-postgres ghcr.io/hpi-sam/dps_training_k-postgres:latest
docker push ghcr.io/hpi-sam/dps_training_k-postgres:latest
# Skip redis as it is just the public Docker Hub image anyway and therefore should be directly pulled from there
- name: Prepare deployment files
run: |
mkdir deployment_files
cp docker-compose.yml deployment_files/
cp frontend/env.d.ts deployment_files/
cp backend/dps_training_k/.env deployment_files/
- name: Archive deployment files
uses: actions/upload-artifact@v2
with:
name: deployment-files
path: deployment_files/