Skip to content

Move output to subdir (#4) #18

Move output to subdir (#4)

Move output to subdir (#4) #18

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 site
on:
push:
branches: ['main']
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🗂 Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: recursive
lfs: true
fetch-depth: 1
- name: 🗂 Checkout asf-site branch with minimum depth
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # 3.5.3
if: ${{ github.event_name == 'push' }}
with:
ref: asf-site
fetch-depth: 1
path: asf-site
- name: 🔧 Build site
run: |
rm -rf asf-site/output/*
./build.sh -Ddocs.dest=asf-site/output
- name: 🚀 Add commit to the asf-site
if: ${{ github.event_name == 'push' }}
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