Skip to content

deploy

deploy #9

Workflow file for this run

name: deploy
on:
workflow_run:
workflows: ["build"]
types:
- completed
jobs:
deploy:
name: Deploy to production
runs-on: prod
environment: prod
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Copy docker-compose.yml
run: |
mkdir -p ${{ secrets.PROJECT_PATH }}
cp -f ./deploy/docker-compose.yml ${{ secrets.PROJECT_PATH }}/docker-compose.yml
echo ${{ secrets.BACKEND_ENV_CONTENT }} > ${{ secrets.PROJECT_PATH }}/.backend.env
echo ${{ secrets.MONGO_ENV_CONTENT }} > ${{ secrets.PROJECT_PATH }}/.mongo.env
-
name: Pull changes and restart
run: |
cd ${{ secrets.PROJECT_PATH }}
docker compose down --remove-orphans
docker compose pull
docker compose up -d