mirror of
https://github.com/friendica/docker
synced 2025-01-01 10:35:21 +01:00
Optimize Github Action Workflow
This commit is contained in:
parent
dd4aec3ee5
commit
f3a07949e6
2 changed files with 27 additions and 17 deletions
12
.github/workflows/images.yml
vendored
12
.github/workflows/images.yml
vendored
|
@ -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 }}
|
||||
|
|
32
.github/workflows/update-sh.yml
vendored
32
.github/workflows/update-sh.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue