Code Quality Pipeline / Test (push) Successful in 4m21s
CI Pipeline / Test (pull_request) Successful in 4m27s
CI Pipeline / Build and Publish (./Dockerfile.model, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/model) (pull_request) Successful in 15s
CI Pipeline / Build and Publish (./Dockerfile.web_ui, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/web_ui) (pull_request) Successful in 13s
74 lines
2.0 KiB
YAML
74 lines
2.0 KiB
YAML
name: CI Pipeline
|
|
run-name: ${{ gitea.actor }} is running the CI Pipeline
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
- name: Setup Environment
|
|
uses: https://github.com/actions/setup-python@v3
|
|
with:
|
|
python-verison: "3.12"
|
|
architecture: "x64"
|
|
- name: Install Packages
|
|
run: |
|
|
pip install poetry
|
|
poetry install
|
|
- name: PEP8 Check
|
|
run: |
|
|
poetry run flake8 . --benchmark
|
|
- name: Type Check
|
|
run: |
|
|
poetry run mypy .
|
|
publish:
|
|
name: Build and Publish
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
-
|
|
dockerfile: ./Dockerfile.web_ui
|
|
image: ${{ vars.docker_repo_url }}/${{ gitea.repository }}/web_ui
|
|
-
|
|
dockerfile: ./Dockerfile.model
|
|
image: ${{ vars.docker_repo_url }}/${{ gitea.repository }}/model
|
|
steps:
|
|
-
|
|
name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set Environment Variables
|
|
run: |
|
|
echo "sha_short=$(git rev-parse --short ${{ gitea.sha }} )" >> "$GITHUB_ENV"
|
|
-
|
|
name: Show Environment Variables
|
|
run: |
|
|
echo "DOCKER_REPO_URL: ${{ vars.docker_repo_url }}"
|
|
echo "REPOSITORY: ${{ gitea.repository }}"
|
|
echo "COMMIT_SHA: ${{ env.sha_short }}"
|
|
-
|
|
name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ matrix.image }}
|
|
-
|
|
name: Build and Push Image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ${{ matrix.dockerfile }}
|
|
push: true
|
|
tags: |
|
|
${{ matrix.image }}:${{ env.sha_short }}
|
|
${{ matrix.image }}:latest
|
|
labels: ${{ steps.meta.outputs.labels }}
|