BETA VERSION 0.68.4 #827
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deployment BETA | |
on: | |
release: | |
types: [published] | |
jobs: | |
test: | |
uses: ./.github/workflows/test-build.yml | |
deploy: | |
runs-on: self-hosted | |
needs: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: beta | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Get production data | |
run: | | |
cp ../.env .env | |
cp ../docker-compose.override.yml docker-compose.override.yml | |
- name: Check if .env file has content | |
run: | | |
if grep -q . .env; then | |
echo ".env file is not empty" | |
else | |
echo ".env file is empty" | |
echo "stop_workflow=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Check if docker-compose.override.yml file has content | |
run: | | |
if grep -q . docker-compose.override.yml; then | |
echo "docker-compose.override.yml file is not empty" | |
else | |
echo "docker-compose.override.yml file is empty" | |
echo "stop_workflow=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Build | |
run: | | |
export NODE_ENV=production | |
docker compose down && docker compose up -d | |
- name: Wait 60 seconds and check if all containers are healthy | |
run: | | |
sleep 60 | |
docker ps -a | |
docker inspect --format='{{json .State.Health}}' mittelbot | |
docker inspect --format='{{json .State.Health}}' mittelbot-mysql | |
- name: Stop Workflow | |
if: steps.check_condition.outputs.stop_workflow == 'true' | |
run: | | |
echo "Stopping workflow" | |
exit 0 |