Add create-snapshot workflow

This commit is contained in:
Johannes Meyer 2021-07-20 09:44:42 +02:00
parent bdd1c5c9c2
commit 56aaf91bd4
1 changed files with 37 additions and 0 deletions

37
.github/workflows/create-snapshot.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Create Snapshot
on:
schedule:
# Every day at 4pm
- cron: "0 16 * * *"
workflow_dispatch:
jobs:
make-snapshot:
name: Make a nightly snapshot
runs-on: ubuntu-latest
if: github.repository == 'Icinga/icinga-php-library'
steps:
- name: Checkout code base
uses: actions/checkout@v2
- name: Prepare Git environment
run: |
git config user.name "icingabot"
git config user.email "65761963+icingabot@users.noreply.github.com"
echo '{"github-oauth": {"github.com": "${{ secrets.ICINGABOT_TOKEN }}"}}' > auth.json
echo 'auth.json' >> .gitignore
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '5.6'
- name: Create snapshot/nightly
if: success()
run: bin/make-snapshot.sh snapshot/nightly
- name: Push snapshot/nightly
if: success()
run: git push -f origin snapshot/nightly