changed service name in prod compose #37
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: 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/.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 |