|
|
@ -3,24 +3,28 @@ name: Pages |
|
|
|
on: |
|
|
|
push: |
|
|
|
branches: |
|
|
|
- main # default branch |
|
|
|
- main # dein Default-Branch |
|
|
|
|
|
|
|
jobs: |
|
|
|
pages: |
|
|
|
build: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
# Repository auschecken |
|
|
|
# Repository auschecken (inkl. Submodules, falls du welche nutzt) |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
with: |
|
|
|
token: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
submodules: recursive |
|
|
|
|
|
|
|
# Node.js-Umgebung einrichten |
|
|
|
- name: Use Node.js 12.x |
|
|
|
# Node.js-Umgebung auf Version 22 setzen |
|
|
|
- name: Use Node.js 22 |
|
|
|
uses: actions/setup-node@v4 |
|
|
|
with: |
|
|
|
node-version: '12.x' |
|
|
|
# passend zu deiner lokalen Node-Version 22.14.0 |
|
|
|
node-version: "22" |
|
|
|
|
|
|
|
# NPM-Dependencies cachen (v3 statt v2!) |
|
|
|
# NPM-Dependencies cachen |
|
|
|
- name: Cache NPM dependencies |
|
|
|
uses: actions/cache@v3 |
|
|
|
uses: actions/cache@v4 |
|
|
|
with: |
|
|
|
path: node_modules |
|
|
|
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }} |
|
|
@ -34,10 +38,23 @@ jobs: |
|
|
|
- name: Build |
|
|
|
run: npm run build |
|
|
|
|
|
|
|
# GitHub Pages deploy |
|
|
|
- name: Deploy |
|
|
|
uses: peaceiris/actions-gh-pages@v4 |
|
|
|
# Artefakt für GitHub Pages hochladen |
|
|
|
- name: Upload Pages artifact |
|
|
|
uses: actions/upload-pages-artifact@v3 |
|
|
|
with: |
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
publish_dir: ./public |
|
|
|
publish_branch: master # deploying branch |
|
|
|
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 |