Skip to content

Commit 8bd6d16

Browse files
committed
ci(build): update CI to use GitHub Actions for Zola and PR preview system
Signed-off-by: Laura Santamaria <[email protected]>
1 parent cbd3791 commit 8bd6d16

File tree

4 files changed

+43
-109
lines changed

4 files changed

+43
-109
lines changed

.github/ISSUE_TEMPLATE/new_project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Check the site https://redhatofficial.github.io first to ensure this project is
1717
To add a new project we need:
1818
- Project name
1919
- Project description
20-
- Link to the github repository
20+
- Link to the GitHub repository
2121
- Link to the project's website
2222
- General category for this project
2323

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
Your updates should work in the following environments:
2020

2121
- [ ] Latest 2 versions of Edge
22-
- [ ] Internet Explorer 11 (should be useable, not pixel perfect)
23-
- [ ] Latest 2 versions of Firefox (one on Mac OS, one of Windows OS)
22+
- [ ] Internet Explorer 11 (should be usable, not pixel perfect)
23+
- [ ] Latest 2 versions of Firefox (one on macOS, one of Windows OS)
2424
- [ ] Firefox 68 (or latest version for Red Hat Enterprise Linux distribution)
25-
- [ ] Latest 2 versions of Chrome (one on Mac OS, one of Windows OS)
25+
- [ ] Latest 2 versions of Chrome (one on macOS, one of Windows OS)
2626
- [ ] Latest 2 versions of Safari
2727
- [ ] Android mobile device (such as the Galaxy S9)
2828
- [ ] Apple mobile device (such as the iPhone X)

.github/workflows/build.yml

Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,43 @@
1-
name: Validate build & urls
2-
on: [pull_request]
3-
jobs:
4-
build:
5-
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
node-version: [12.x]
9-
steps:
10-
- name: Checkout repository
11-
uses: actions/checkout@v2
1+
name: Build site
122

13-
- name: Capture changed files
14-
uses: jitterbit/get-changed-files@v1
15-
id: files
16-
with:
17-
format: csv
18-
token: ${{ secrets.GITHUB_TOKEN }}
3+
on:
4+
push:
5+
branches: [ "dev" ]
6+
pull_request:
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
- closed
1912

20-
- name: Cache node modules
21-
uses: actions/cache@v2
22-
env:
23-
cache-name: cache-node-modules
24-
with:
25-
# npm cache files are stored in `~/.npm` on Linux/macOS
26-
path: ~/.npm
27-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
28-
restore-keys: |
29-
${{ runner.os }}-build-${{ env.cache-name }}-
30-
${{ runner.os }}-build-
31-
${{ runner.os }}-
13+
concurrency: preview-${{ github.ref }}
3214

33-
- name: Install dependencies
34-
run: npm install
15+
env:
16+
CARGO_TERM_COLOR: always
3517

36-
- name: Backwards compatibility
37-
run: |
38-
mkdir -p dist
39-
npm run babel
40-
41-
- name: Build
42-
run: npm run build
43-
44-
- name: Validate URLs
45-
# Only run this if these files were edited
46-
if: contains(steps.files.outputs.added_modified, 'app/data/*.json')
47-
uses: urlstechie/[email protected]
48-
with:
49-
# Only validate the files that were changed
50-
include_files: ${{ steps.files.outputs.added_modified }}
51-
sub_folder: app/data/
52-
file_types: .json
53-
timeout: 3
18+
jobs:
19+
build_and_deploy:
20+
runs-on: ubuntu-latest
21+
if: github.ref == 'refs/heads/dev'
22+
steps:
23+
- name: Check out repository
24+
uses: actions/checkout@v4
25+
- name: Build and deploy
26+
uses: shalzz/[email protected]
27+
env:
28+
PAGES_BRANCH: gh-pages
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
preview:
31+
runs-on: ubuntu-latest
32+
if: github.ref != 'refs/heads/dev'
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Install and build
37+
if: github.event.action != 'closed'
38+
uses: shalzz/[email protected]
39+
env:
40+
BUILD_ONLY: true
41+
BUILD_FLAGS: --drafts
42+
BUILD_THEMES: false
43+
CHECK_LINKS: true

.github/workflows/pages.yml

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

0 commit comments

Comments
 (0)