diff --git a/.gitea/workflows/deploy_prod.yaml b/.gitea/workflows/deploy_prod.yaml new file mode 100644 index 00000000..9c22f329 --- /dev/null +++ b/.gitea/workflows/deploy_prod.yaml @@ -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_(qVE&}7T" + MYSQL_DATABASE: "kd_kdb" + ports: + - "3307:3306" + volumes: + - kdb_db_prod_1:/var/lib/mysql + deploy: + mode: replicated + replicas: 1 + placement: + constraints: [ node.role == manager ] + resources: + reservations: + cpus: "0.1" + memory: 150M + +networks: + reverse_proxy: + external: true + kdb_prod: + driver: overlay + attachable: true \ No newline at end of file diff --git a/kdb-web/package.json b/kdb-web/package.json index c640dd53..2ec300d9 100644 --- a/kdb-web/package.json +++ b/kdb-web/package.json @@ -13,6 +13,7 @@ "predocker-build": "npm run update-version", "docker-build": "export VERSION=$npm_package_version; ng build; docker build -t sh-edraft.de/kdb-web:$VERSION .", "docker-build-dev": "export VERSION=$npm_package_version; ng build --configuration development; docker build -t sh-edraft.de/kdb-web:$VERSION .", + "docker-build-stage": "export VERSION=$npm_package_version; ng build --configuration staging; docker build -t sh-edraft.de/kdb-web:$VERSION ." }, "private": true,