2020-08-31 13:40:11 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-03-08 17:36:16 +00:00
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2020-08-31 13:40:11 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-23 09:05:23 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-08-31 13:40:11 +00:00
|
|
|
|
|
|
|
- name: Setup Hugo
|
2022-10-25 06:42:05 +00:00
|
|
|
uses: peaceiris/actions-hugo@v2.6.0
|
2020-08-31 13:40:11 +00:00
|
|
|
with:
|
|
|
|
hugo-version: latest
|
|
|
|
|
|
|
|
- name: Build local ./exampleSite
|
2023-03-15 12:32:22 +00:00
|
|
|
run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://janraasch.github.io/hugo-bearblog/
|
2024-01-23 10:07:09 +00:00
|
|
|
|
2023-03-08 17:36:16 +00:00
|
|
|
- name: Upload Artifact
|
2024-01-23 09:36:08 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-08-31 13:40:11 +00:00
|
|
|
with:
|
2023-03-08 17:36:16 +00:00
|
|
|
name: build
|
|
|
|
path: ./public
|
2024-01-23 10:07:09 +00:00
|
|
|
|
2023-03-08 18:03:20 +00:00
|
|
|
dependabot:
|
|
|
|
name: Dependabot Auto-Merge
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
2024-01-23 10:17:51 +00:00
|
|
|
permissions:
|
|
|
|
issues: write
|
|
|
|
pull-requests: write
|
2023-03-08 18:03:20 +00:00
|
|
|
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
|
|
|
|
steps:
|
|
|
|
- name: Dependabot metadata
|
|
|
|
id: dependabot-metadata
|
|
|
|
uses: dependabot/fetch-metadata@v1
|
|
|
|
with:
|
|
|
|
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
- name: Enable auto-merge for Dependabot PRs
|
|
|
|
if: contains(fromJSON('["version-update:semver-patch", "version-update:semver-minor"]'), steps.dependabot-metadata.outputs.update-type)
|
2024-01-23 10:07:09 +00:00
|
|
|
run: |
|
|
|
|
gh pr review --approve "$PR_URL"
|
|
|
|
gh pr merge --auto --squash "$PR_URL"
|
2023-03-08 18:03:20 +00:00
|
|
|
env:
|
|
|
|
PR_URL: ${{github.event.pull_request.html_url}}
|
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
2023-03-08 17:36:16 +00:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
needs: build
|
|
|
|
name: Deploy to GitHub Pages
|
|
|
|
runs-on: ubuntu-latest
|
2023-03-08 17:45:36 +00:00
|
|
|
if: github.event_name == 'push'
|
2023-03-08 17:36:16 +00:00
|
|
|
steps:
|
2024-01-23 09:05:23 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-23 09:33:33 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-03-08 17:36:16 +00:00
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: ./public
|
2023-03-15 12:32:22 +00:00
|
|
|
- uses: peaceiris/actions-gh-pages@v3.9.2
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./public
|