diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 2a9216f..b6122ac 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -19,27 +19,13 @@ jobs: - name: Build Astro Site run: npm run build - # env: - # PUBLIC_API_URL: ${{ secrets.PUBLIC_API_URL }} - # --------------------------------------------------------- - # CASE 1: PRODUCTION (Main Branch) - # --------------------------------------------------------- - name: Deploy to Production if: gitea.ref == 'refs/heads/main' - run: npx netlify-cli deploy --prod --dir=dist --site=${{ secrets.NETLIFY_SITE_ID }} --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --message "Prod: ${{ gitea.sha }}" + run: npx netlify-cli deploy --prod --dir=dist --site=${{ secrets.NETLIFY_SITE_ID }} --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --message "Prod ${{ gitea.sha }}" - # --------------------------------------------------------- - # CASE 2: PREVIEW (Any other branch) - # --------------------------------------------------------- - - name: Deploy Preview with Subdomain + - name: Deploy Preview if: gitea.ref != 'refs/heads/main' run: | - # 1. Get the branch name (e.g., 'feature/login') - # 2. Replace slashes with dashes (e.g., 'feature-login') because URLs can't have slashes ALIAS=$(echo "${{ gitea.ref_name }}" | tr / -) - - echo "Deploying to alias: $ALIAS" - - # 3. Deploy with the --alias flag - npx netlify-cli deploy --dir=dist --alias "$ALIAS" --site=${{ secrets.NETLIFY_SITE_ID }} --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --message "Preview: $ALIAS" \ No newline at end of file + npx netlify-cli deploy --dir=dist --alias "$ALIAS" --site=${{ secrets.NETLIFY_SITE_ID }} --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --message "Preview $ALIAS" \ No newline at end of file