Skip to content

Commit

Permalink
Merge pull request #334 from hpi-sam/fix-artifacts-v2-deprecation
Browse files Browse the repository at this point in the history
Improve workflows
  • Loading branch information
Wolkenfarmer authored Oct 4, 2024
2 parents ea519a3 + c087d3a commit 54f4cc6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Build frontend Docker container
run: |
Expand All @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Build backend Docker containers
run: |
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -88,6 +88,7 @@ jobs:

- name: Run docker containers with deploy dev configuration
run: |
cp backend/dps_training_k/deployment/nginx/nginx_deploy_dev.conf ./nginx_dev.conf
docker compose -f docker-compose.dev.yml up -d
- name: Run integration tests
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down Expand Up @@ -48,13 +48,16 @@ jobs:
- name: Prepare deployment files
run: |
mkdir deployment_files
cp docker-compose.prod.yml deployment_files/docker-compose.yml
cp ./.env.prod deployment_files/
cp ./.env.dev deployment_files/
cp backend/dps_training_k/deployment/nginx/nginx_deploy_prod.conf deployment_files/nginx.conf
cp docker-compose.prod.yml deployment_files/docker-compose.prod.yml
cp docker-compose.dev.yml deployment_files/docker-compose.dev.yml
cp .env.prod deployment_files/.env.prod
cp .env.dev deployment_files/.env.dev
cp backend/dps_training_k/deployment/nginx/nginx_deploy_prod.conf deployment_files/nginx_prod.conf
cp backend/dps_training_k/deployment/nginx/nginx_deploy_dev.conf deployment_files/nginx_dev.conf
- name: Archive deployment files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: deployment-files
path: deployment_files/
include-hidden-files: true
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ services:
- django
volumes:
- static_volume:/app/staticfiles
- ./backend/dps_training_k/deployment/nginx/nginx_deploy_dev.conf:/etc/nginx/conf.d/nginx.conf
- ./nginx_dev.conf:/etc/nginx/conf.d/nginx.conf
ports:
- "80:80"
- "443:443"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ services:
- static_volume:/app/staticfiles
- /etc/letsencrypt/live/klinik-dps.de/fullchain.pem:/etc/nginx/ssl/fullchain.pem:ro
- /etc/letsencrypt/live/klinik-dps.de/privkey.pem:/etc/nginx/ssl/privkey.pem:ro
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf
- ./nginx_prod.conf:/etc/nginx/conf.d/nginx.conf
ports:
- "80:80"
- "443:443"
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ docker login ghcr.io -u <username> -p <token>
```
8. Run following commands to run the containers:
```bash
docker compose -f docker-compose.<dev/prod>.yml up --build
docker compose -f docker-compose.<dev/prod>.yml up
```

The application is now deployed and the website should be accessible via http (`dev`) or https (`prod`). The images will be automatically updated on each
Expand Down

0 comments on commit 54f4cc6

Please sign in to comment.