Skip to content

Commit

Permalink
Update deploy workflow to fix url issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixpereira committed May 28, 2024
1 parent 5311c7e commit e7dce3e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up environment variables
run: |
echo "NEXT_PUBLIC_HUGGINGFACE_API_TOKEN=${{ secrets.NEXT_PUBLIC_HUGGINGFACE_API_TOKEN }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }}" >> $GITHUB_ENV
- name: Install pnpm
run: npm install -g pnpm

- name: Detect package manager
id: detect-package-manager
run: |
Expand All @@ -55,11 +62,13 @@ jobs:
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}

- name: Setup Pages
uses: actions/configure-pages@v5
with:
Expand All @@ -68,6 +77,7 @@ jobs:
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next

- name: Restore cache
uses: actions/cache@v4
with:
Expand All @@ -78,10 +88,13 @@ jobs:
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml', '**/yarn.lock', '**/package-lock.json') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}

- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand All @@ -95,11 +108,6 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Set up environment variables
run: |
echo "NEXT_PUBLIC_HUGGINGFACE_API_TOKEN=${{ secrets.NEXT_PUBLIC_HUGGINGFACE_API_TOKEN }}" >> .env
echo "NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }}" >> .env
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit e7dce3e

Please sign in to comment.