diff --git a/.github/workflows/ci-and-deploy.yml b/.github/workflows/ci-and-deploy.yml index 29bfd821..0ca659df 100644 --- a/.github/workflows/ci-and-deploy.yml +++ b/.github/workflows/ci-and-deploy.yml @@ -17,6 +17,7 @@ on: env: PR_URL: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }} + BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }} jobs: init: @@ -25,7 +26,7 @@ jobs: steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache dependencies id: cache @@ -47,7 +48,7 @@ jobs: steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache dependencies id: cache @@ -85,7 +86,7 @@ jobs: steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache dependencies id: cache @@ -102,6 +103,8 @@ jobs: - name: Build run: yarn pages:build + env: + NEXT_PUBLIC_API_URL: ${{ env.BRANCH_NAME == 'prod' && secrets.NEXT_PUBLIC_API_URL || secrets.NEXT_PUBLIC_API_URL_DEV }} - name: Deploy to Cloudflare id: deploy @@ -110,7 +113,7 @@ jobs: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} - command: pages deploy --branch=${{ github.event.pull_request.head.ref || github.ref_name }} + command: pages deploy --branch=${{ env.BRANCH_NAME }} outputs: preview-url: ${{ steps.deploy.outputs.pages-deployment-alias-url }} @@ -123,7 +126,7 @@ jobs: if: always() steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Send Lint Failed Notification if: ${{ needs.lint.result == 'failure' }} @@ -149,5 +152,5 @@ jobs: with: TYPE: success TITLE: "✅ Build Succeeded" - DESCRIPTION: "Preview URL: ${{ needs.build_and_deploy.outputs.preview-url }}\\nEnvironment: ${{ needs.build_and_deploy.outputs.deploy-env }})" + DESCRIPTION: "Preview URL: ${{ needs.build_and_deploy.outputs.preview-url }}\\nEnvironment: ${{ needs.build_and_deploy.outputs.deploy-env }}" DISCORD_WEBHOOK_URL: ${{ secrets.SANDBOX_DISCORD_WEBHOOK_URL }} diff --git a/.github/workflows/cleanup-cache-after-merge.yml b/.github/workflows/cleanup-cache-after-merge.yml index 796468ac..0338ea71 100644 --- a/.github/workflows/cleanup-cache-after-merge.yml +++ b/.github/workflows/cleanup-cache-after-merge.yml @@ -13,7 +13,7 @@ jobs: contents: read steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cleanup cache run: | diff --git a/.github/workflows/pr-notification.yml b/.github/workflows/pr-notification.yml index 9c5982af..af6ae2f6 100644 --- a/.github/workflows/pr-notification.yml +++ b/.github/workflows/pr-notification.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Send PR Notification uses: ./.github/actions/notification diff --git a/.github/workflows/update-i18n.yml b/.github/workflows/update-i18n.yml index 6a9f223d..464db846 100644 --- a/.github/workflows/update-i18n.yml +++ b/.github/workflows/update-i18n.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Fetch i18n Translations run: node fetchTranslations.js