Create Snapshot #782
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: Create Snapshot | |
on: | |
schedule: | |
# Every day at 6pm | |
- cron: "0 18 * * *" | |
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@v3 | |
with: | |
fetch-depth: 0 | |
- name: Prepare Git environment | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@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: '7.2' | |
- 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 |