Skip to content

Commit e3e896c

Browse files
Dale KunceDale Kunce
authored andcommitted
feat: migrate from Travis CI to GitHub Actions
- Remove Travis CI configuration (.travis.yml) and build scripts - Add comprehensive GitHub Actions workflows: * deploy.yml: CI/CD pipeline with GitHub Pages deployment * test.yml: Pull request testing and validation * security.yml: Weekly security and dependency audits * manual-deploy.yml: On-demand deployment with environment options - Configure Dependabot for automated dependency updates: * NPM packages, Ruby gems, and GitHub Actions * Weekly schedule with automatic PR assignment * Grouped updates by dependency type - Add GitHub issue templates for better bug reporting - Update package.json with improved npm scripts: * npm run build: Production build via gulp prod * npm test: Linting + building for CI validation * npm run clean: Clean build artifacts - Update README.md with comprehensive CI/CD documentation - Modern GitHub Actions features: * Matrix builds, caching, artifacts * Proper permissions and security * Environment-specific deployments * Built-in GitHub Pages integration Migration benefits: ✅ Better GitHub integration and security ✅ Faster builds with native GitHub infrastructure ✅ Automated dependency management with Dependabot ✅ More granular workflow control ✅ No external CI service dependencies ✅ Built-in GitHub Pages deployment
1 parent 53edeaf commit e3e896c

12 files changed

Lines changed: 547 additions & 71 deletions

File tree

.build_scripts/deploy.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

.build_scripts/lint.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Bug Report
2+
description: Report a bug or issue with the Missing Maps website
3+
title: "[Bug]: "
4+
labels: ["bug", "needs-triage"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to report a bug! Please fill out the form below to help us understand and reproduce the issue.
12+
13+
- type: input
14+
id: url
15+
attributes:
16+
label: Page URL
17+
description: What page were you on when you encountered the bug?
18+
placeholder: https://www.missingmaps.org/...
19+
validations:
20+
required: false
21+
22+
- type: textarea
23+
id: description
24+
attributes:
25+
label: Bug Description
26+
description: A clear and concise description of what the bug is
27+
placeholder: Describe what happened and what you expected to happen
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: steps
33+
attributes:
34+
label: Steps to Reproduce
35+
description: How can we reproduce this bug?
36+
placeholder: |
37+
1. Go to...
38+
2. Click on...
39+
3. Scroll down to...
40+
4. See error
41+
validations:
42+
required: true
43+
44+
- type: dropdown
45+
id: browsers
46+
attributes:
47+
label: Browser
48+
description: What browser are you using?
49+
options:
50+
- Chrome
51+
- Firefox
52+
- Safari
53+
- Edge
54+
- Mobile Safari
55+
- Mobile Chrome
56+
- Other
57+
validations:
58+
required: false
59+
60+
- type: dropdown
61+
id: device
62+
attributes:
63+
label: Device Type
64+
description: What type of device are you using?
65+
options:
66+
- Desktop
67+
- Mobile
68+
- Tablet
69+
validations:
70+
required: false
71+
72+
- type: textarea
73+
id: additional
74+
attributes:
75+
label: Additional Context
76+
description: Add any other context about the problem here, including screenshots if helpful
77+
validations:
78+
required: false

.github/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains the CI/CD workflows for the Missing Maps website.
4+
5+
## Workflows
6+
7+
### 📦 `deploy.yml` - CI/CD Pipeline
8+
- **Triggers**: Push to `main`, `master`, or `publish` branches; Pull requests
9+
- **Purpose**: Build and deploy the site to GitHub Pages
10+
- **Features**:
11+
- Ruby and Node.js environment setup
12+
- Dependency caching
13+
- JavaScript linting
14+
- Jekyll build with Gulp
15+
- Automated deployment to GitHub Pages (publish branch only)
16+
17+
### 🧪 `test.yml` - Pull Request Tests
18+
- **Triggers**: Pull requests to main branches
19+
- **Purpose**: Test builds and validate changes
20+
- **Features**:
21+
- Build verification
22+
- Asset generation checks
23+
- Lint validation
24+
25+
### 🔒 `security.yml` - Security and Dependency Checks
26+
- **Triggers**: Weekly schedule, dependency file changes, manual trigger
27+
- **Purpose**: Monitor security and dependency health
28+
- **Features**:
29+
- NPM security audit
30+
- Ruby security audit with bundler-audit
31+
- Outdated dependency checks
32+
- Code linting and formatting validation
33+
34+
## Dependabot Configuration
35+
36+
The `.github/dependabot.yml` file configures automated dependency updates:
37+
- **NPM packages**: Weekly updates on Sundays
38+
- **Ruby gems**: Weekly updates on Sundays
39+
- **GitHub Actions**: Weekly updates on Sundays
40+
- **Grouping**: Development vs production dependencies
41+
- **Auto-assignment**: PRs assigned to maintainers
42+
43+
## Migration from Travis CI
44+
45+
This setup replaces the previous Travis CI configuration with modern GitHub Actions:
46+
- ✅ Improved security with GitHub's built-in secrets management
47+
- ✅ Better integration with GitHub features
48+
- ✅ More granular control over workflows
49+
- ✅ Built-in GitHub Pages deployment
50+
- ✅ Automated dependency management
51+
52+
## Required Secrets
53+
54+
No additional secrets are required - GitHub Actions uses built-in `GITHUB_TOKEN` for deployment.
55+
56+
## Branch Strategy
57+
58+
- **`publish`**: Production deployment branch (auto-deploys to GitHub Pages)
59+
- **`main`/`master`**: Development branch (tests only)
60+
- **Feature branches**: Pull request testing only

.github/dependabot.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "sunday"
9+
time: "02:00"
10+
open-pull-requests-limit: 10
11+
reviewers:
12+
- "MissingMaps/maintainers"
13+
assignees:
14+
- "dalekunce"
15+
commit-message:
16+
prefix: "deps"
17+
prefix-development: "deps-dev"
18+
include: "scope"
19+
groups:
20+
development-dependencies:
21+
dependency-type: "development"
22+
patterns:
23+
- "*"
24+
production-dependencies:
25+
dependency-type: "production"
26+
patterns:
27+
- "*"
28+
29+
# Enable version updates for bundler
30+
- package-ecosystem: "bundler"
31+
directory: "/"
32+
schedule:
33+
interval: "weekly"
34+
day: "sunday"
35+
time: "02:00"
36+
open-pull-requests-limit: 5
37+
reviewers:
38+
- "MissingMaps/maintainers"
39+
assignees:
40+
- "dalekunce"
41+
commit-message:
42+
prefix: "deps"
43+
include: "scope"
44+
45+
# Enable version updates for GitHub Actions
46+
- package-ecosystem: "github-actions"
47+
directory: "/"
48+
schedule:
49+
interval: "weekly"
50+
day: "sunday"
51+
time: "02:00"
52+
open-pull-requests-limit: 5
53+
reviewers:
54+
- "MissingMaps/maintainers"
55+
assignees:
56+
- "dalekunce"
57+
commit-message:
58+
prefix: "ci"
59+
include: "scope"

.github/workflows/deploy.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, master, publish ]
6+
pull_request:
7+
branches: [ main, master, publish ]
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
# Build job
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
29+
30+
- name: Setup Ruby
31+
uses: ruby/setup-ruby@v1
32+
with:
33+
ruby-version: '3.3.5'
34+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version-file: '.nvmrc'
40+
cache: 'npm'
41+
42+
- name: Install Node.js dependencies
43+
run: npm ci
44+
45+
- name: Install Gulp CLI
46+
run: npm install -g gulp-cli
47+
48+
- name: Lint JavaScript
49+
run: npm run lint
50+
51+
- name: Build site
52+
run: gulp prod
53+
env:
54+
JEKYLL_ENV: production
55+
56+
- name: Upload build artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: site-build
60+
path: _site/
61+
retention-days: 1
62+
63+
# Deployment job for GitHub Pages
64+
deploy:
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
runs-on: ubuntu-latest
69+
needs: build
70+
if: github.ref == 'refs/heads/publish' && github.event_name == 'push'
71+
steps:
72+
- name: Download build artifacts
73+
uses: actions/download-artifact@v4
74+
with:
75+
name: site-build
76+
path: _site/
77+
78+
- name: Setup Pages
79+
uses: actions/configure-pages@v4
80+
81+
- name: Upload to GitHub Pages
82+
uses: actions/upload-pages-artifact@v3
83+
with:
84+
path: _site/
85+
86+
- name: Deploy to GitHub Pages
87+
id: deployment
88+
uses: actions/deploy-pages@v4
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Manual Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Deployment environment'
8+
required: true
9+
default: 'staging'
10+
type: choice
11+
options:
12+
- staging
13+
- production
14+
skip_tests:
15+
description: 'Skip test suite'
16+
required: false
17+
default: false
18+
type: boolean
19+
20+
jobs:
21+
deploy:
22+
runs-on: ubuntu-latest
23+
environment: ${{ github.event.inputs.environment }}
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Ruby
30+
uses: ruby/setup-ruby@v1
31+
with:
32+
ruby-version: '3.3.5'
33+
bundler-cache: true
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version-file: '.nvmrc'
39+
cache: 'npm'
40+
41+
- name: Install dependencies
42+
run: |
43+
npm ci
44+
npm install -g gulp-cli
45+
46+
- name: Run tests
47+
if: ${{ !inputs.skip_tests }}
48+
run: npm test
49+
50+
- name: Build for staging
51+
if: ${{ inputs.environment == 'staging' }}
52+
run: gulp serve --build-only
53+
env:
54+
JEKYLL_ENV: development
55+
56+
- name: Build for production
57+
if: ${{ inputs.environment == 'production' }}
58+
run: gulp prod
59+
env:
60+
JEKYLL_ENV: production
61+
62+
- name: Upload artifacts
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: site-${{ inputs.environment }}-${{ github.sha }}
66+
path: _site/
67+
retention-days: 7
68+
69+
- name: Deploy notification
70+
run: |
71+
echo "🚀 Deployment completed for ${{ inputs.environment }}"
72+
echo "📦 Build artifacts uploaded"
73+
echo "🔗 Commit: ${{ github.sha }}"

0 commit comments

Comments
 (0)