Skip to content

Commit 5d7089e

Browse files
authored
Migrate CI from Travis to GitHub Actions (#46)
Travis CI is no longer running for this repo. Replace .travis.yml with an equivalent GitHub Actions workflow that builds the Hugo site (with the grunt content-index step) and pushes the rendered output to the master branch via peaceiris/actions-gh-pages. Hugo version, build steps, and target branch are unchanged so GitHub Pages keeps serving from the same place. README badge updated to point at the new workflow.
1 parent 3e984a2 commit 5d7089e

3 files changed

Lines changed: 56 additions & 55 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- src
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: pages-deploy
14+
cancel-in-progress: false
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
env:
20+
HUGO_VERSION: 0.88.1
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
submodules: true
26+
fetch-depth: 0
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: lts/*
32+
33+
- name: Setup Hugo
34+
uses: peaceiris/actions-hugo@v3
35+
with:
36+
hugo-version: ${{ env.HUGO_VERSION }}
37+
38+
- name: Install dependencies
39+
run: |
40+
npm install -g grunt-cli yarn
41+
yarn set version latest
42+
yarn install --no-lockfile
43+
44+
- name: Build content index
45+
run: grunt content-index
46+
47+
- name: Build site
48+
run: hugo --minify
49+
50+
- name: Deploy to GitHub Pages
51+
uses: peaceiris/actions-gh-pages@v4
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
publish_dir: ./public
55+
publish_branch: master

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SourceBans++ Website [![Travis branch](https://img.shields.io/travis/sbpp/sbpp.github.io/src.svg?style=flat-square)](https://travis-ci.org/sbpp/sbpp.github.io)
1+
# SourceBans++ Website [![Build and Deploy](https://github.com/sbpp/sbpp.github.io/actions/workflows/deploy.yml/badge.svg?branch=src)](https://github.com/sbpp/sbpp.github.io/actions/workflows/deploy.yml)
22

33
### Adding Articles
44

0 commit comments

Comments
 (0)