eaasy #1127
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: Docker Prod | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create env file (ROOT) | |
run: | | |
touch .env | |
echo POSTGRES_USER=${{ secrets.POSTGRES_USER }} > .env | |
echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env | |
echo POSTGRES_HOST=${{ secrets.POSTGRES_HOST }} >> .env | |
echo POSTGRES_DB=${{ secrets.POSTGRES_DB }} >> .env | |
echo VITE_HOST_URL=${{ secrets.VITE_HOST_URL }} >> .env | |
echo VITE_BOT_URL=http://coding-global-bot:3000 >> .env | |
echo VITE_GUILD_ID=693908458986143824 >> .env | |
echo VITE_AUTH_PATH=/api/auth >> .env | |
echo AUTH_URL=${{ secrets.VITE_HOST_URL }} >> .env | |
echo AUTH_SECRET=${{ secrets.AUTH_SECRET }} >> .env | |
echo AUTH_TRUST_HOST=${{ secrets.AUTH_TRUST_HOST }} >> .env | |
echo DISCORD_CLIENT_ID=${{ secrets.DISCORD_CLIENT_ID }} >> .env | |
echo DISCORD_CLIENT_SECRET=${{ secrets.DISCORD_CLIENT_SECRET }} >> .env | |
- name: Docker compose rename override file | |
run: mv docker-compose-prod.yml docker-compose.yml | |
- name: Reset DB | |
run: docker stop coding-global-web-db || true && docker rm coding-global-web-db || true | |
- name: Docker run | |
run: docker compose up -d --force-recreate --build |