Add debug statement to fetchMoviesByCategory function #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- development | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
CI: false | |
outputs: | |
manager: ${{ steps.detect-package-manager.outputs.manager }} | |
command: ${{ steps.detect-package-manager.outputs.command }} | |
runner: ${{ steps.detect-package-manager.outputs.runner }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Detect package manager | |
id: detect-package-manager | |
run: | | |
if [ -f "yarn.lock" ]; then | |
echo "manager=yarn" >> $GITHUB_ENV | |
echo "command=install" >> $GITHUB_ENV | |
echo "runner=yarn" >> $GITHUB_ENV | |
echo "::set-output name=manager::yarn" | |
echo "::set-output name=command::install" | |
echo "::set-output name=runner::yarn" | |
elif [ -f "package.json" ]; then | |
echo "manager=npm" >> $GITHUB_ENV | |
echo "command=ci" >> $GITHUB_ENV | |
echo "runner=npm run" >> $GITHUB_ENV | |
echo "::set-output name=manager::npm" | |
echo "::set-output name=command::ci" | |
echo "::set-output name=runner::npx --no-install" | |
else | |
echo "Unable to determine package manager" | |
exit 1 | |
fi | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
cache: ${{ steps.detect-package-manager.outputs.manager }} | |
- name: Install npm at specific version | |
run: npm install -g npm@latest | |
- name: Create env file | |
env: | |
REACT_APP_TMDB_API_KEY: ${{ secrets.REACT_APP_TMDB_API_KEY }} | |
PUBLIC_URL: "https://uretzkyzvi.github.io/nexwind-components" | |
run: | | |
touch .env | |
echo REACT_APP_TMDB_API_KEY=$REACT_APP_TMDB_API_KEY > .env | |
echo PUBLIC_URL=$PUBLIC_URL >> .env | |
- name: Install dependencies | |
run: ${{ env.manager }} ${{ env.command }} | |
- name: Build project | |
env: | |
PUBLIC_URL: "https://uretzkyzvi.github.io/nexwind-components" | |
run: CI=false ${{ env.runner }} build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
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 |