Skip to content

Instantly share code, notes, and snippets.

@osteel
Created January 10, 2021 16:18
Show Gist options
  • Save osteel/122390a968e52315c0dd2b270beeab5d to your computer and use it in GitHub Desktop.
Save osteel/122390a968e52315c0dd2b270beeab5d to your computer and use it in GitHub Desktop.
Example GitHub Action to instal Composer dependencies and run a PHP script
name: Update blog posts
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Install Composer dependencies
run: composer install
- name: Insert blog posts
run: php posts.php
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Updated latest blog posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment