From a7d980d68a6236a66121ca2784dcf2cee13c6918 Mon Sep 17 00:00:00 2001 From: Denshooter <44590296+Denshooter@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:19:21 +0100 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11c85a7..8f60a98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Deploy Next.js to Raspberry Pi on: push: branches: - - main + - production - dev - preview @@ -17,8 +17,8 @@ jobs: - name: Set Environment Variables run: | - if [[ "${{ github.ref_name }}" == "main" ]]; then - echo "DEPLOY_ENV=main" >> $GITHUB_ENV + if [[ "${{ github.ref_name }}" == "production" ]]; then + echo "DEPLOY_ENV=production" >> $GITHUB_ENV echo "PORT=3000" >> $GITHUB_ENV elif [[ "${{ github.ref_name }}" == "dev" ]]; then echo "DEPLOY_ENV=dev" >> $GITHUB_ENV @@ -57,7 +57,7 @@ jobs: # Rename new container to the old container’s name docker rename "$NEW_CONTAINER_NAME" "$CONTAINER_NAME" - # Reassign the desired port (e.g., 3000 for main branch) to the new container + # Reassign the desired port (e.g., 3000 for production branch) to the new container docker run -d --name "$CONTAINER_NAME" -p $PORT:3000 $IMAGE_NAME else echo "New container failed to start."