From 1dc36d272da727816b5728b58f4d7c8c1e68b092 Mon Sep 17 00:00:00 2001 From: James Almeida Date: Sun, 22 Sep 2024 14:06:21 -0700 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fe2edd..ec7921e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,8 +5,13 @@ on: branches: - main # Set this to your default branch +permissions: + contents: read + pages: write + id-token: write + jobs: - deploy: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -19,7 +24,6 @@ jobs: - name: Create env file run: | echo "REACT_APP_GOOGLE_MAPS_API_KEY=${{ secrets.REACT_APP_GOOGLE_MAPS_API_KEY }}" >> .env - echo "REACT_APP_GOOGLE_MAPS_MAP_ID=${{ secrets.REACT_APP_GOOGLE_MAPS_MAP_ID }}" >> .env - name: Install dependencies run: npm install @@ -27,8 +31,18 @@ jobs: - name: Build run: CI=false npm run build - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build + path: ./build + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4