Created
January 10, 2021 16:18
-
-
Save osteel/122390a968e52315c0dd2b270beeab5d to your computer and use it in GitHub Desktop.
Example GitHub Action to instal Composer dependencies and run a PHP script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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