Compare commits

...

5 Commits

Author SHA1 Message Date
b15288ef42 Fix commit
Some checks failed
Deploy to GitHub Pages / build (push) Failing after 53s
Deploy to GitHub Pages / deploy (push) Has been skipped
2025-05-17 22:07:28 +00:00
e41c77a48b Fix: Correct --user format for gh-pages 2025-05-17 22:03:32 +00:00
cac1a70eda Fix: Update gh-pages command in deployment workflow 2025-05-17 22:02:00 +00:00
d7c781d532 Configure GitHub Pages deployment via Actions 2025-05-17 21:59:17 +00:00
8ec303fdd2 Remove Gitea-specific workflow for GitHub Pages deployment 2025-05-17 21:57:40 +00:00
3 changed files with 56 additions and 72 deletions

View File

@ -1,71 +0,0 @@
name: Build, Lint, and Deploy Arctic Species Portal
on:
push:
branches:
- main # Or your primary branch, e.g., master
pull_request: # Also run on pull requests to main
branches:
- main
jobs:
test-and-build: # Renamed job for clarity
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: Install dependencies
run: npm install
- name: Lint project
run: npm run lint # Runs your ESLint command
- name: Build project
run: npm run build # Runs tsc && vite build
# This will also catch TypeScript errors
- name: List output files # Optional: just to see build output in logs
if: success() # Only run if build succeeds
run: |
echo "Build completed. Output files in dist/:"
ls -R dist
deploy: # New job for deployment, depends on test-and-build
needs: test-and-build # Ensures this job runs only if test-and-build succeeds
if: gitea.event_name == 'push' && gitea.ref_name == 'main' # Corrected for Gitea
runs-on: ubuntu-latest
steps:
# We need to checkout and build again, or pass artifacts
# For simplicity in this example, let's re-checkout and re-build
# A more advanced setup would pass 'dist' as an artifact from the 'test-and-build' job
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build # Ensure the production assets are built for deployment
- name: Deploy to Production (Placeholder)
run: |
echo "Deployment step: Replace this with your actual deployment commands."
echo "Files from 'dist/' are ready for deployment."
# Example for copying to a server (requires SSH setup):
# scp -r dist/* user@yourserver:/var/www/your-project-path/
# Or using rsync:
# rsync -avz dist/ user@yourserver:/var/www/your-project-path/

55
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: Deploy to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20" # Or your preferred Node.js version
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build # This should output to 'dist' based on your package.json
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: "./dist"
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@ -3,7 +3,7 @@
"private": true, "private": true,
"version": "0.1.0", "version": "0.1.0",
"type": "module", "type": "module",
"homepage": "https://magnussmari.github.io/arctic-species-2025-frontend", "homepage": "https://magnussmari.github.io/Arctic_portal_temp/",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",