Compare commits
	
		
			No commits in common. "a1e7985cf8edd70844a0ece6740388ebd12a6b5e" and "13a389efc8782862b1ce42f708b5530184040e96" have entirely different histories.
		
	
	
		
			a1e7985cf8
			...
			13a389efc8
		
	
		
| @ -1,2 +1,5 @@ | ||||
| NEXT_PUBLIC_FASTAPI_URL="http://localhost:8000" | ||||
| FASTAPI_URL="http://localhost:8000" | ||||
| INTERNAL_API_BASE_URL="http://localhost:3005" | ||||
| 
 | ||||
| DATABASE_URL="postgresql://user:pass@localhost:5432/rooftop?schema=public" | ||||
| JWT_SECRET="secret_key" | ||||
|  | ||||
| @ -1,58 +0,0 @@ | ||||
| name: Build and Deploy | ||||
| 
 | ||||
| on: | ||||
|     push: | ||||
|         tags: | ||||
|             - "v*" | ||||
| 
 | ||||
| jobs: | ||||
|     build-and-deploy: | ||||
|         runs-on: ubuntu-latest | ||||
| 
 | ||||
|         steps: | ||||
|             - name: Checkout Code | ||||
|               uses: actions/checkout@v3 | ||||
| 
 | ||||
|             - name: Extract Tag Name | ||||
|               id: extract_tag | ||||
|               run: | | ||||
|                   TAG_NAME=${GITHUB_REF#refs/tags/} | ||||
|                   echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT | ||||
| 
 | ||||
|             - name: Set up Docker Buildx | ||||
|               uses: docker/setup-buildx-action@v3 | ||||
| 
 | ||||
|             - name: Login to Docker Hub | ||||
|               uses: docker/login-action@v3 | ||||
|               with: | ||||
|                   username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||
|                   password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||||
|               env: | ||||
|                   NEXT_PUBLIC_FASTAPI_URL: ${{ secrets.NEXT_PUBLIC_FASTAPI_URL }}    | ||||
| 
 | ||||
|             - name: Build and Push Docker Image | ||||
|               uses: docker/build-push-action@v5 | ||||
|               with: | ||||
|                   context: . | ||||
|                   file: ./Dockerfile | ||||
|                   push: true | ||||
|                   tags: | | ||||
|                       rooftopenergy/powermeter-frontend:${{ steps.extract_tag.outputs.tag }} | ||||
| 
 | ||||
|             - name: SSH and Deploy | ||||
|               uses: appleboy/ssh-action@master | ||||
|               with: | ||||
|                   host: ${{ secrets.SSH_HOST }} | ||||
|                   username: ${{ secrets.SSH_USER }} | ||||
|                   key: ${{ secrets.SSH_PRIVATE_KEY }} | ||||
|                   script: | | ||||
|                       echo "Using tag: ${{ steps.extract_tag.outputs.tag }}" | ||||
| 
 | ||||
|                       cd /root/power-meter-dashboard | ||||
| 
 | ||||
|                       sed -i "s|rooftopenergy/powermeter-frontend:.*|rooftopenergy/powermeter-frontend:${{ steps.extract_tag.outputs.tag }}|g" docker-compose.yml | ||||
| 
 | ||||
|                       docker compose down | ||||
|                       docker compose pull | ||||
|                       docker compose up -d | ||||
|                        | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user