generated from langrenn-sprint/result-service-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.37 KB
/
deploy_webserver.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: Test, build and deploy webserver
on:
push:
branches:
- main
jobs:
build-and-deploy:
name: Build, test and deploy to GitHub Container registry
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
architecture: x64
- name: Install dependencies
run: |-
pipx install poetry==1.7.1
pipx install nox==2023.4.22
pipx inject nox nox-poetry
- name: Build image and test with nox
run: |-
nox
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
ADMIN_USERNAME: ${{ secrets.ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Tag and publish docker image to Github Container registry
env:
GITHUB_TOKEN: ${{ github.token }}
run: |-
docker tag ghcr.io/langrenn-sprint/photo-service-gui:test ghcr.io/langrenn-sprint/photo-service-gui:latest
docker rmi ghcr.io/langrenn-sprint/photo-service-gui:test
docker push ghcr.io/langrenn-sprint/photo-service-gui:latest