2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-05-24 09:54:57 +02:00

Merge pull request #126 from nupplaphil/task/github_actions

Optimize Github Action Workflow
This commit is contained in:
Tobias Diekershoff 2020-08-31 07:06:42 +02:00 committed by GitHub
commit c9f6832368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 17 deletions

View file

@ -1,10 +1,12 @@
name: GitHub CI
name: Images
on:
pull_request:
push:
schedule:
- cron: 0 0 * * 0
workflow_run:
workflows: ["update.sh"]
branches: [stable]
types:
- completed
defaults:
run:
@ -36,6 +38,8 @@ jobs:
- uses: actions/checkout@v2
- name: Prepare Environment
run: ${{ matrix.runs.prepare }}
- name: Run update.sh script
run: ./update.sh
- name: Pull Dependencies
run: ${{ matrix.runs.pull }}
- name: Build ${{ matrix.name }}

View file

@ -1,22 +1,28 @@
name: update.sh
on:
pull_request:
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
push:
branches:
- stable
schedule:
- cron: '15 0 * * *'
jobs:
check-changes:
name: Check for Changes
run_update_sh:
name: Run update.sh script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check for Changes
- name: Run update.sh script
run: ./update.sh
- name: Commit files
run: |
hash_before="$(git write-tree)"
./update.sh
git add -A
[[ "$hash_before" = "$(git write-tree)" ]]
git config --local user.email "workflow@github.com"
git config --local user.name "GitHub Workflow"
git add ./*
git commit -m "Runs update.sh" || echo "Nothing to update"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true