Create pages.yml workflow with explicit upload-artifact@v4

This commit is contained in:
Admin9705
2025-05-16 21:29:56 -04:00
parent 5d24430ce4
commit 495cf68c1d

58
.github/workflows/pages.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: Deploy GitHub Pages
on:
push:
branches: [ main ]
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build docs
run: |
# Create .nojekyll file to disable Jekyll
touch docs/.nojekyll
# Use upload-artifact@v4 explicitly
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: docs
retention-days: 1
# Download the same artifact for deployment
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: _site
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: _site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2