2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-06-16 16:27:53 +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: on:
pull_request: pull_request:
push: workflow_run:
schedule: workflows: ["update.sh"]
- cron: 0 0 * * 0 branches: [stable]
types:
- completed
defaults: defaults:
run: run:
@ -36,6 +38,8 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Prepare Environment - name: Prepare Environment
run: ${{ matrix.runs.prepare }} run: ${{ matrix.runs.prepare }}
- name: Run update.sh script
run: ./update.sh
- name: Pull Dependencies - name: Pull Dependencies
run: ${{ matrix.runs.pull }} run: ${{ matrix.runs.pull }}
- name: Build ${{ matrix.name }} - name: Build ${{ matrix.name }}

View file

@ -1,22 +1,28 @@
name: update.sh name: update.sh
on: on:
pull_request: push:
branches:
defaults: - stable
run: schedule:
shell: 'bash -Eeuo pipefail -x {0}' - cron: '15 0 * * *'
jobs: jobs:
run_update_sh:
check-changes: name: Run update.sh script
name: Check for Changes
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Check for Changes - name: Run update.sh script
run: ./update.sh
- name: Commit files
run: | run: |
hash_before="$(git write-tree)" git config --local user.email "workflow@github.com"
./update.sh git config --local user.name "GitHub Workflow"
git add -A git add ./*
[[ "$hash_before" = "$(git write-tree)" ]] 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