Skip to content

build Myblog

build Myblog #469

Workflow file for this run

name: build Myblog
on:
workflow_dispatch:
issues:
types: [opened, edited]
#schedule:
# - cron: "0 16 * * *"
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
name: Generate blog
runs-on: ubuntu-latest
if: ${{ github.event.repository.owner.id == github.event.sender.id || github.event_name == 'schedule' }}
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Get config.json
run: |
echo "====== check config.josn file ======"
cat config.json
echo "====== check config.josn end ======"
sudo apt-get install jq
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Generate new html
run: |
python Gmeek.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --issue_number '${{ github.event.issue.number }}'
- name: update html
run: |
git config --local user.email "$(jq -r ".email" config.json)"
git config --local user.name "${{ github.repository_owner }}"
git add .
git commit -a -m '🎉auto update by Gmeek action' || echo "nothing to commit"
git push || echo "nothing to push"
sleep 3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/.'
deploy:
name: Deploy blog
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4