ci: use GITHUB_TOKEN #19
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: ci | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [22] | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@master | |
- name: Setup node env 🏗 | |
uses: actions/setup-node@v4.0.3 | |
with: | |
node-version: ${{ matrix.node }} | |
check-latest: true | |
- name: Cache node_modules 📦 | |
uses: actions/cache@v4.0.2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies 👨🏻💻 | |
run: npm ci --prefer-offline --no-audit | |
- name: Prepare Nuxt | |
run: npx nuxt prepare | |
- name: Run linter 👀 | |
run: npm run lint | |
- name: Run prettier | |
run: npx prettier --check . | |
- name: Build 🚚 | |
if: success() | |
run: npm run generate | |
- name: Deploy to GitHub Pages | |
if: success() | |
uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
build_dir: dist | |
fqdn: 3-in-2.com | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |