From 379c200892a928218246e0e2ba1b5baae23241e5 Mon Sep 17 00:00:00 2001 From: Michaelninder <151365993+Michaelninder@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:42:38 +0100 Subject: [PATCH] Create snake.yml --- .github/workflows/snake.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/snake.yml diff --git a/.github/workflows/snake.yml b/.github/workflows/snake.yml new file mode 100644 index 0000000..154c354 --- /dev/null +++ b/.github/workflows/snake.yml @@ -0,0 +1,42 @@ +name: GitHub Snake Game + +on: + # Schedule the workflow to run daily at midnight UTC + schedule: + - cron: "0 0 * * *" + # Allow manual triggering of the workflow + workflow_dispatch: + # Trigger the workflow on pushes to the main branch + push: + branches: + - main +jobs: + generate: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + # Step 1: Checkout the repository + - name: Checkout Repository + uses: actions/checkout@v3 + # Step 2: Generate the snake animations + - name: Generate GitHub Contributions Snake Animations + uses: Platane/snk@v3 + with: + # GitHub username to generate the animation for + github_user_name: ${{ github.repository_owner }} + # Define the output files and their configurations + outputs: | + dist/github-snake.svg + dist/github-snake-dark.svg?palette=github-dark + dist/ocean.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Step 3: Deploy the generated files to the 'output' branch + - name: Deploy to Output Branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist + publish_branch: output + # Optionally, you can set a custom commit message + commit_message: "Update snake animation [skip ci]"