You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
name: Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # dein Default-Branch
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Repository auschecken (inkl. Submodules, falls du welche nutzt)
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
submodules: recursive
|
|
|
|
# Node.js-Umgebung auf Version 22 setzen
|
|
- name: Use Node.js 22
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
# passend zu deiner lokalen Node-Version 22.14.0
|
|
node-version: "22"
|
|
|
|
# NPM-Dependencies cachen
|
|
- name: Cache NPM dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-npm-cache-
|
|
|
|
# Install & Build
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
# Artefakt für GitHub Pages hochladen
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./public
|
|
|
|
deploy:
|
|
needs: build
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
# Seite nachher automatisch gesetzte URL
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|