Files
pyzebra/.gitea/workflows/deploy.yaml
Ivan Usov 56f6268364
All checks were successful
pyzebra CI/CD pipeline / test-env (push) Successful in 2m14s
pyzebra CI/CD pipeline / prod-env (push) Has been skipped
pyzebra CI/CD pipeline / cleanup (push) Successful in 1s
Fix cicd workflow output
2026-02-24 09:55:29 +01:00

46 lines
1.4 KiB
YAML

name: pyzebra CI/CD pipeline
on:
push:
branches:
- main
tags:
- '*'
env:
CONDA: /opt/miniforge3
jobs:
test-env:
runs-on: pyzebra
if: github.ref == 'refs/heads/main'
env:
BUILD_DIR: ${{ runner.temp }}/conda_build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: $CONDA/bin/conda build --no-anaconda-upload --output-folder $BUILD_DIR ./conda-recipe
- run: $CONDA/bin/conda remove --yes --quiet --name test --all --keep-env
- run: $CONDA/bin/conda install --yes --quiet --name test --channel $BUILD_DIR python=3.10 pyzebra
- run: sudo systemctl restart pyzebra-test.service
prod-env:
runs-on: pyzebra
if: startsWith(github.ref, 'refs/tags/')
env:
BUILD_DIR: ${{ runner.temp }}/conda_build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: $CONDA/bin/conda build --token ${{ secrets.ANACONDA_TOKEN }} --output-folder $BUILD_DIR ./conda-recipe
- run: $CONDA/bin/conda remove --yes --quiet --name prod --all --keep-env
- run: $CONDA/bin/conda install --yes --quiet --name prod --channel $BUILD_DIR python=3.10 pyzebra
- run: sudo systemctl restart pyzebra-prod.service
cleanup:
runs-on: pyzebra
needs: [test-env, prod-env]
if: always()
steps:
- run: $CONDA/bin/conda build purge-all