Files
visual_critical_discourse_a…/.gitea/workflows/publish.yaml
T
Brian Bjarke Jensen 68a542be04
Code Quality Pipeline / Test (push) Failing after 3m27s
CI Pipeline / Test (pull_request) Failing after 3m39s
CI Pipeline / Build and Publish (./Dockerfile.model, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/model) (pull_request) Has been skipped
CI Pipeline / Build and Publish (./Dockerfile.web_ui, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/web_ui) (pull_request) Has been skipped
updated CI
2024-05-21 19:16:59 +02:00

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 . --disable-error-code=import-untyped
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 }}