Compare commits
5 Commits
6398335c7b
...
b15288ef42
Author | SHA1 | Date | |
---|---|---|---|
b15288ef42 | |||
e41c77a48b | |||
cac1a70eda | |||
d7c781d532 | |||
8ec303fdd2 |
@ -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
55
.github/workflows/deploy.yml
vendored
Normal 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
|
@ -3,7 +3,7 @@
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"homepage": "https://magnussmari.github.io/arctic-species-2025-frontend",
|
||||
"homepage": "https://magnussmari.github.io/Arctic_portal_temp/",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
|
Reference in New Issue
Block a user