Build and Deploy to GH Pages #632
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: Hugo build | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
#nightly to keep statistics updated | |
schedule: | |
- cron: '12 0 * * *' | |
jobs: | |
hugo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Checkout Backend | |
uses: actions/checkout@v3 | |
with: | |
repository: 'KaotoIO/kaoto-backend' | |
path: 'tmp/kaoto-backend' | |
fetch-depth: '0' | |
- name: Checkout Frontend | |
uses: actions/checkout@v3 | |
with: | |
repository: 'KaotoIO/kaoto-ui' | |
path: 'tmp/kaoto-ui' | |
fetch-depth: '0' | |
- name: Generate Contributors | |
run: ./getGitData.sh | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax | |
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified | |
- name: Install Python dependencies | |
run: pip3 install requests | |
- name: Generate Releases | |
run: python3 getGithubData.py $username $password | |
env: | |
username: ${{ secrets.API_USER }} | |
password: ${{ secrets.API_PASSWORD }} | |
- name: Run Hugo | |
uses: crazy-max/ghaction-hugo@v2 | |
if: always() | |
with: | |
version: latest | |
extended: false | |
args: --cleanDestinationDir --minify --verbose | |
- name: Setup CNAME correctly | |
if: always() | |
run: cp CNAME public/CNAME | |
- | |
name: Deploy to GitHub Pages | |
if: success() && github.event_name != 'pull_request' | |
uses: crazy-max/ghaction-github-pages@v3 | |
with: | |
target_branch: public | |
build_dir: public | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |