Skip to content

Switch Attic to new Jekyll Generated Website #10

Switch Attic to new Jekyll Generated Website

Switch Attic to new Jekyll Generated Website #10

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Build Attic site
on:
push:
branches: ['main']
pull_request:
jobs:
website:
runs-on: ubuntu-latest
steps:
- name: πŸ—‚ Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 1
- name: πŸ—‚ Checkout asf-site branch with minimum depth
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
with:
ref: asf-site
fetch-depth: 1
path: asf-site
- name: πŸ—‚ Checkout cwiki-retired branch with minimum depth
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
with:
ref: cwiki-retired
fetch-depth: 1
path: cwiki-retired
- name: Set up Ruby
# Although ubuntu-latest includes ruby 3.2.2, this step is needed to set up bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
bundler-cache: true
- name: πŸ”§ Build site
run: |
rm -rf asf-site/output/*
rm -rf cwiki-retired/*
ruby --version
bundle exec jekyll build -d asf-site/output
mv asf-site/output/cwiki_retired/* cwiki-retired
rm -rf asf-site/output/cwiki_retired
- name: πŸš€ Add commit to the asf-site branch
working-directory: asf-site
run: |
echo "Running git config"
git config user.name "GitHub Actions"
git config user.email "[email protected]"
echo "Running git add -A"
git add -A .
echo "Running git commit"
if git commit -m "Regenerated website based on ${GITHUB_SHA} commit"
then
git push origin asf-site
fi
- name: πŸš€ Add commit to the cwiki-retired branch
working-directory: cwiki-retired
run: |
echo "Running git config"
git config user.name "GitHub Actions"
git config user.email "[email protected]"
echo "Running git add -A"
git add -A .
echo "Running git commit"
if git commit -m "Regenerated website based on ${GITHUB_SHA} commit"
then
git push origin cwiki-retired
fi