All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 4m11s
78 lines
2.1 KiB
YAML
78 lines
2.1 KiB
YAML
name: Deploy prod on push
|
|
run-name: Deploy prod 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"
|
|
token: ${{ secrets.CI_GITHUB_ACCESS_TOKEN }}
|
|
- 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
|
|
with:
|
|
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
submodules: true
|
|
|
|
- name: Prepare bot build
|
|
run: |
|
|
cd bot
|
|
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
|
cpl i
|
|
|
|
- name: Setup node
|
|
uses: https://github.com/actions/setup-node@v3
|
|
|
|
- name: Prepare web build
|
|
run: |
|
|
cd web
|
|
npm install -g ts-node
|
|
npm ci
|
|
|
|
- name: Shutdown stack
|
|
run: docker stack rm sdb_prod
|
|
|
|
- name: Build docker bot
|
|
run: |
|
|
cd bot
|
|
docker image prune -f
|
|
cpl build
|
|
docker build -t sh-edraft.de/sdb-bot:$(cpl gv) .
|
|
|
|
- name: Build docker web
|
|
run: |
|
|
cd web
|
|
docker image prune -f
|
|
npm run build
|
|
docker build -t sh-edraft.de/sdb-web:$(npm run -s gv) .
|
|
|
|
- name: Set version
|
|
run: |
|
|
cd bot/docker
|
|
chmod +x ./set-docker-compose-image-version.sh
|
|
./set-docker-compose-image-version.sh sh-edraft.de/sdb-bot:$(cd ../; cpl gv) sh-edraft.de/sdb-web:$(cd ../../web; npm run -s gv;)
|
|
|
|
- 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: "${{ secrets.docker_job }}"
|
|
portainer-endpoint: 2
|
|
name: sdb_prod
|
|
file: bot/docker/docker-compose.yml
|
|
variables: '{}'
|