Tried to add CI/CD #369

This commit is contained in:
2023-09-27 17:21:11 +02:00
parent 99bfa9874a
commit 987a1a664b
5 changed files with 286 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
name: Deploy dev on push
run-name: Deploy dev on push
on:
push:
branches:
- master
jobs:
on-push-deploy_sh-edraft:
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
container: catthehacker/ubuntu:act-latest
steps:
- name: Setup Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- run: python -v
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
- name: Install cpl cli
run: |
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
- name: Install deps
run: cpl i
- name: Build docker
run: |
docker stack rm service_observer
docker image prune -f
cpl docker-build
- name: Deploy Stack to sh-edraft.de
uses: https://github.com/kgierke/portainer-stack-deployment@v1
with:
portainer-url: "https://docker.sh-edraft.de"
portainer-username: "gitea_job"
portainer-password: "$T8bS5;ge_(q<B9e^:9W4}=)"
portainer-endpoint: 2
name: service_observer
file: ./docker-compose.yml
variables: '{}'

View File

@@ -0,0 +1,62 @@
name: Deploy dev on push
run-name: Deploy dev on push
on:
push:
branches:
- support
jobs:
on-push-deploy_sh-edraft:
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
container: catthehacker/ubuntu:act-latest
steps:
- name: Setup Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- run: python -v
- name: Setup docker
uses: https://github.com/papodaca/install-docker-action@main
- run: docker -v
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
- name: Shutdown stack
run: docker stack rm kdb_staging
- name: Prepare bot build
run: |
cd kdb-bot
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
cpl i
- name: Build docker bot
run: |
docker image prune -f
cpl docker-build
- name: Setup node
uses: https://github.com/actions/setup-node@v3
- name: Prepare web build
run: |
cd ../kdb-web
npm i
- name: Build docker web
run: |
docker image prune -f
npm run docker-build-stage
- name: Deploy Stack to sh-edraft.de
uses: https://github.com/kgierke/portainer-stack-deployment@v1
with:
portainer-url: "https://docker.sh-edraft.de"
portainer-username: "gitea_job"
portainer-password: "$T8bS5;ge_(q<B9e^:9W4}=)"
portainer-endpoint: 2
name: kdb_staging
file: ./docker-compose.staging.yml
variables: '{}'