Skip to content

Merge pull request #12 from 4l3j0Ok/development #30

Merge pull request #12 from 4l3j0Ok/development

Merge pull request #12 from 4l3j0Ok/development #30

Workflow file for this run

name: deploy
on:
workflow_dispatch:
workflow_run:
workflows: ["build"]
types:
- completed
push:
branches:
- main
paths:
- "stack/**"
jobs:
deploy:
name: Deploy to production
runs-on: self-hosted
environment: prod
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Setting up Stack
run: |
mkdir -p $PROJECT_PATH
cp -f ./stack/prod.compose.yml $PROJECT_PATH/docker-compose.yml
echo "$ENV_CONTENT" > $PROJECT_PATH/.backend.env
env:
PROJECT_PATH: ${{ secrets.PROJECT_PATH }}
ENV_CONTENT: ${{ secrets.ENV_CONTENT }}
-
name: Pull changes and restart
run: |
cd ${{ secrets.PROJECT_PATH }}
docker compose down --remove-orphans
docker compose pull
docker compose up -d