Update static.yml #65
This file contains hidden or 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 static content to Pages | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Schritt 1: Checkout nur der notwendigen Dateien (Sparse Checkout) | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
sparse-checkout: | | |
/path/to/static/files/** | |
# Schritt 2: Kopieren der statischen Dateien in das Public-Verzeichnis | |
- name: Prepare Content | |
run: | | |
mkdir -p public | |
rsync -av --delete ./path/to/static/files/ ./public/ | |
# Schritt 3: Setup Pages | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
# Schritt 4: Upload artifact | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: public | |
# Schritt 5: Deploy auf GitHub Pages | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |