From 886543d1f993fe9345bcbf33779a272f38398a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= Date: Sun, 25 Feb 2024 03:09:02 +0900 Subject: [PATCH] chore: try vars --- .github/workflows/build.yml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1be4b01..2f756a24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build & Deploy on: push: - pull_request_target: # Changed from pull_request to pull_request_target + pull_request: workflow_dispatch: permissions: @@ -15,19 +15,20 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.ref }} # Check out the base branch, not the PR - - - name: Fetch PR code - run: | - git fetch origin ${{ github.event.pull_request.head.sha }} - git checkout FETCH_HEAD + # with: + # submodules: "recursive" # Ensures submodules are checked out - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 20.10.0 + + - name: Use Organization Variable + run: | + echo ${{ vars.SUPABASE_URL }} + echo ${{ vars.SUPABASE_ANON_KEY }} + - name: Build run: | echo $SUPABASE_URL @@ -35,20 +36,22 @@ jobs: echo $APP_ID echo $APP_INSTALLATION_ID echo $APP_PRIVATE_KEY - yarn yarn build env: # Set environment variables for the build - SUPABASE_URL: ${{ secrets.SUPABASE_URL }} - SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} - APP_ID: ${{ secrets.APP_ID }} - APP_INSTALLATION_ID: ${{ secrets.APP_INSTALLATION_ID }} - APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} + SUPABASE_URL: ${{ vars.SUPABASE_URL }} + SUPABASE_ANON_KEY: ${{ vars.SUPABASE_ANON_KEY }} + APP_ID: ${{ vars.APP_ID }} + APP_INSTALLATION_ID: ${{ vars.APP_INSTALLATION_ID }} + APP_PRIVATE_KEY: ${{ vars.APP_PRIVATE_KEY }} - name: Deploy to Cloudflare + if: env.skip != 'true' uses: ubiquity/cloudflare-deploy-action@main with: repository: ${{ github.repository }} production_branch: ${{ github.event.repository.default_branch }} output_directory: "static" - current_branch: ${{ github.ref_name }} \ No newline at end of file + current_branch: ${{ github.ref_name }} + pull_request_number: ${{ github.event.pull_request.number }} + commit_sha: ${{ github.event.pull_request.head.sha }}