Skip to content

generate-awesome-wallpapers #28

generate-awesome-wallpapers

generate-awesome-wallpapers #28

name: generate-awesome-wallpapers
on:
# Run automatically everyday at 00:05
schedule:
- cron: "5 0 * * *"
# Allows to manually run the job at any time
workflow_dispatch:
# Allow workflow to be reusable
workflow_call:
secrets:
HF_API_TOKEN:
required: true
# Run on every push or pull request on main branch
push:
branches: [ "main" ]
permissions:
contents: write
# Only a single workflow in the same concurrency will run at the same time
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
generate_wallpaper:
name: Generate awesome wallpapers with Javascript
runs-on: ubuntu-latest
steps:
# Checkout the main branch
- uses: actions/checkout@v4
# Uses action in the root directory to generate awesome wallpapers
- name: Generate awesome wallpapers
uses: huuquyet/[email protected]
env:
HF_API_TOKEN: ${{ secrets.HF_API_TOKEN }}
# Push awesome wallpapers to main branch
# Note: the following account information will not work on GHES
- name: Push the awesome wallpapers to main branch
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m ":robot: Generated awesome wallpaper"
git push