add examples of centos and rocky #261
This file contains 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
name: Linux Guide and Hints CI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
cache: 'pip' | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
cache: 'npm' | |
- name: pip dependencies | |
run: | | |
pip3 install -U --user -r requirements.txt | |
- name: npm dependencies | |
run: | | |
npm ci | |
- name: sphinx build | |
run: | | |
cd $GITHUB_WORKSPACE | |
make html SPHINXBUILD=$HOME/.local/bin/sphinx-build | |
env: | |
CI: true | |
- name: deploy | |
run: | | |
git clone --branch='gh-pages' --depth=1 https://github.com/nazunalika/linux-guide-and-hints.git gh-pages | |
cd gh-pages | |
git config user.email '[email protected]' | |
git config user.name 'github deployment bot' | |
cp -r $GITHUB_WORKSPACE/build/html/* . | |
cp -r $GITHUB_WORKSPACE/.nojekyll . | |
cp -r $GITHUB_WORKSPACE/CNAME . | |
git add -A . | |
set +e | |
git commit -m 'Deploy to gh-pages.' | |
# If there was nothing to commit... | |
if [[ $? == 1 ]]; then | |
echo "Nothing to commit. Skipping deploy." | |
# Exit with a good status so the build does not fail | |
exit 0 | |
else | |
set -e | |
git push https://nazunalika:"${{ secrets.GH_PAGES_TOKEN }}"@github.com/nazunalika/linux-guide-and-hints.git | |
fi |