Merge pull request #3 from smngvlkz/my-setup-branch #1
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: Next.js Capedev Site | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Clear npm cache | |
run: npm cache clean --force | |
- name: Install Dependencies | |
run: npm install --legacy-peer-deps | |
- name: Run ESLint | |
run: npm run lint | |
continue-on-error: true | |
- name: Build Next.js Site | |
run: npm run build | |
- name: Verify Build Output | |
run: ls -la out | |
- name: Print Directory Structure | |
run: find out | |
- name: Check HTML Files | |
run: cat out/index.html | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: out |