Skip to content

Update redirect.hbs #28

Update redirect.hbs

Update redirect.hbs #28

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [ "master", 'dev' ]
paths-ignore:
- '**.md'
- '**.txt'
- '.gitignore'
workflow_dispatch:
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Check directory contents
run: ls -la
- name: Create package.json if not exists
run: |
if [ ! -f package.json ]; then
echo "Creating basic package.json"
echo '{
"name": "khalilcharfi-portfolio",
"version": "1.0.0",
"description": "Khalil Charfi portfolio website",
"scripts": {
"build:all": "node scripts/build.js && node scripts/generate-redirect.js && node scripts/generate-meta.js"
},
"dependencies": {
"handlebars": "^4.7.8",
"html-minifier": "^4.0.0"
}
}' > package.json
fi
- name: Install dependencies
run: npm i
- name: Generate static site
run: |
npm run build:all
ls -la dist
env:
NODE_ENV: production
OUTPUT_DIR: ./
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: site-build-files
path: ./
if-no-files-found: error
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: site-build-files
path: ./
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4