Skip to content

Workflow file for this run

name: Test, build and deploy server
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==2022.11.21
pipx inject nox nox-poetry
- name: Build image and test with nox
run: |-
nox
- 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/vision-ai-service:test ghcr.io/langrenn-sprint/vision-ai-service:latest
docker rmi ghcr.io/langrenn-sprint/vision-ai-service:test
docker push ghcr.io/langrenn-sprint/vision-ai-service:latest