Some checks failed
Build and Deploy Thoughts / build-and-deploy-local (push) Failing after 7s
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
name: Build and Deploy Thoughts
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy-local:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Create .env file
|
|
run: |
|
|
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
|
|
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
|
|
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env
|
|
echo "AUTH_SECRET=${{ secrets.AUTH_SECRET }}" >> .env
|
|
echo "NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}" >> .env
|
|
|
|
- name: Build Docker Images Manually
|
|
run: |
|
|
docker build --target runtime -t thoughts-backend:latest ./thoughts-backend
|
|
docker build --target release -t thoughts-frontend:latest --build-arg NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }} ./thoughts-frontend
|
|
docker build -t custom-proxy:latest ./nginx
|
|
|
|
- name: Deploy with Docker Compose
|
|
run: |
|
|
# Use "up" without --build, as images are already built
|
|
docker compose -f compose.prod.yml up -d
|
|
|
|
docker image prune -f |