From 360cbdb7773c32928de8b5f47c0844391d260661 Mon Sep 17 00:00:00 2001 From: Michael <1372930+dodwmd@users.noreply.github.com> Date: Sun, 22 Sep 2024 23:03:50 +1000 Subject: [PATCH] add post --- .github/workflows/generate_post.yaml | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/generate_post.yaml diff --git a/.github/workflows/generate_post.yaml b/.github/workflows/generate_post.yaml new file mode 100644 index 0000000..0a2c5a8 --- /dev/null +++ b/.github/workflows/generate_post.yaml @@ -0,0 +1,46 @@ +name: Generate Blog Content + +on: + workflow_dispatch: + +# Add permissions for the GITHUB_TOKEN +permissions: + contents: write + +jobs: + generate-content: + runs-on: ubuntu-latest + steps: + - name: Checkout blog repository + uses: actions/checkout@v3 + with: + path: blog + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - name: Checkout hugo_generator repository + uses: actions/checkout@v3 + with: + repository: dodwmd/hugo_generator + path: hugo_generator + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install dependencies + uses: py-actions/py-dependency-install@v4 + with: + path: "hugo_generator/requirements.txt" + + - name: Run content generator + run: | + cd hugo_generator + python main.py + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + repository: blog + commit_message: "Auto-generate blog content using hugo_generator" + file_pattern: '.'