Skip to content

change repo path to uhh-cms-tutorials everywhere #3

change repo path to uhh-cms-tutorials everywhere

change repo path to uhh-cms-tutorials everywhere #3

Workflow file for this run

name: Build and Deploy to GitHub Pages
on:
workflow_dispatch:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24" # Use your project's Node version
- name: Install dependencies
run: npm install # Assumes you have a package.json with dependencies
- name: Compile TypeScript
run: npm run build # Assumes "build" script compiles TypeScript and builds the site
- name: Upload build output
uses: actions/upload-artifact@v4
with:
name: build-output
path: ./dist # Adjust the path to your build output folder, e.g., "dist" or "build"
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24" # Use your project's Node version
- name: Install dependencies
run: npm install # Assumes you have a package.json with dependencies
- name: Run ESLint
run: npm run lint # Assumes "lint" script runs ESLint with --fix option
deploy:
needs: build
if: github.ref == 'refs/heads/stable'
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download build output
uses: actions/download-artifact@v4
with:
name: build-output
- name: Deploy to GitHub Pages
id: deployment
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./ # Adjust the path to the downloaded artifact folder
github_token: ${{ secrets.GITHUB_TOKEN }}
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
id-token: write
steps:
- name: Download build output
uses: actions/download-artifact@v4
with:
name: build-output
path: dist
- name: Zip build output
run: |
cd dist
zip -r ../build.zip .
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build.zip
asset_name: build.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}