split site and cwiki-retired workflows #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: Prepare cwiki-retired | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
jobs: | |
cwiki: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🗂 Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
fetch-depth: 1 | |
- 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: 🔧 Prepare cwiki-retired content | |
run: | | |
rm -rf cwiki-retired/* | |
cp cwiki_retired/* cwiki-retired | |
- 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 cwiki-retired based on ${GITHUB_SHA} commit" | |
then | |
git push origin cwiki-retired | |
fi | |