Skip to content

Workflow file for this run

name: Page Builder by ALMO
on:
push:
branches:
- main
paths:
- 'posts/**.md'
- 'config/**'
- 'assets/**'
- 'blog_builder/**'
- '.rebuild'
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Git
run: |
cd ${{ github.workspace }}
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Setup ALMO
run: |
git submodule update --init --recursive --remote
- name: Check g++ version
run: |
g++ --version
- name: Setup g++13
uses: egor-tensin/setup-gcc@v1
with:
version: 13
platform: x64
- name: Check g++ version
run: |
g++ --version
- name: Compile almo.cpp
run: |
cd ALMO
bash build.sh
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: 'posts/**.md'
json: true
- name: Output changed files
run: echo "${{ steps.changed-files.outputs.all_changed_files }}" > changed_files.json
- name: Check need rebuild
id: check
uses: tj-actions/changed-files@v44
with:
files: |
config/**
assets/**
blog_builder/**
.rebuild
- name: Output need rebuild
if: ${{ steps.check.outputs.all_changed_files }} != ""
run: echo "REBUILD=true" >> $GITHUB_ENV
- name: Generate HTML
run: |
python3 blog_builder/build.py
- name: Update RSS
run: |
python3 blog_builder/rss.py
- name: Clean up
run: |
rm changed_files.json
rm tmp.json
- name: Check change
run: |
git diff-index --quiet HEAD || echo "CHANGE=true" >> $GITHUB_ENV
- name: Commit changes
run: |
git add .
git commit --allow-empty -m "Update blog"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main