Skip to content

Commit

Permalink
Update website (#223)
Browse files Browse the repository at this point in the history
* Simplify publishing workflow by skipping staging site
* Update GitHub Actions and use modern way of caching bundler gems
* Update gems
  • Loading branch information
ctubbsii authored Aug 21, 2024
1 parent 28c7b60 commit 9b09f11
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ publish:

jekyll:
whoami: main
target: asf-staging
target: asf-site

12 changes: 2 additions & 10 deletions .github/workflows/jekyll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,13 @@ jobs:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
- name: Cache gems
uses: actions/cache@v3
with:
path: ~/vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem
bundler-cache: true
- name: Test site build
run: |
ruby --version
gem install bundler
bundle config path ~/vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec jekyll build
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ ruby '>=2.7'
source 'https://rubygems.org'
gem 'jekyll', '>= 4.2.0'
gem 'jekyll-redirect-from', '>= 0.16.0'

gem "webrick", "~> 1.7"
19 changes: 10 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.3.1)
concurrent-ruby (1.3.3)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.0)
forwardable-extended (2.6.0)
google-protobuf (4.27.0)
google-protobuf (4.27.2)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
Expand Down Expand Up @@ -51,16 +51,16 @@ GEM
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.5)
public_suffix (6.0.0)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.2.8)
strscan (>= 3.0.9)
rouge (4.2.1)
rexml (3.3.1)
strscan
rouge (4.3.0)
safe_yaml (1.0.5)
sass-embedded (1.77.4)
sass-embedded (1.77.5)
google-protobuf (>= 3.25, < 5.0)
rake (>= 13)
strscan (3.1.0)
Expand All @@ -75,6 +75,7 @@ PLATFORMS
DEPENDENCIES
jekyll (>= 4.2.0)
jekyll-redirect-from (>= 0.16.0)
webrick (~> 1.7)

RUBY VERSION
ruby 2.7.1p83
Expand Down
48 changes: 2 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,56 +68,12 @@ replace any reference to `fluo` with `recipes`.

## Publishing

### Automatic Staging

Changes pushed to our `main` branch will automatically trigger [Jekyll] to
build our site from that branch and push the result to our `asf-staging`
branch, where they will be served on [our default staging site][staging].

### Publishing Staging to Production

First, add our repository as a remote in your local clone, if you haven't
already done so (these commands assume the name of that remote is 'upstream').

Example:

```bash
git clone https://github.com/<yourusername>/fluo-website
cd fluo-website
git remote add upstream https://github.com/apache/fluo-website
```

Next, publish the staging site to production by updating the `asf-site` branch
to match the contents in the `asf-staging` branch:

```bash
# Step 0: stay in main branch; you never need to switch
git checkout main

# Step 1: update your upstream remote
git remote update upstream

# Step 2: push upstream/asf-staging to upstream/asf-site
# run next command with --dry-run first to see what it will do without making changes
git push upstream upstream/asf-staging:asf-site
```

A convenience script can be found that performs these steps for you, after
asking which remote you want to use. It is located in the `main` branch at
`_scripts/publish.sh`

Note that Step 2 should always be a fast-forward merge. That is, there should
never be any reason to force-push it if everything is done correctly. If extra
commits are ever added to `asf-site` that are not present in `asf-staging`,
then those branches will need to be sync'd back up in order to continue
avoiding force pushes.

The final site can be viewed [here][production].

build our site from that branch and push the result to our `asf-site`
branch, where they will be served on [our production site][production].

[Jekyll]: https://jekyllrb.com/
[production]: https://fluo.apache.org
[staging]: https://fluo.staged.apache.org
[ti]: https://github.com/apache/fluo-website/workflows/CI/badge.svg
[tl]: https://github.com/apache/fluo-website/actions
[li]: http://img.shields.io/badge/license-ASL-blue.svg
Expand Down
36 changes: 0 additions & 36 deletions _scripts/publish.sh

This file was deleted.

0 comments on commit 9b09f11

Please sign in to comment.