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:
commit
c9f6832368
12
.github/workflows/images.yml
vendored
12
.github/workflows/images.yml
vendored
|
@ -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 }}
|
||||||
|
|
32
.github/workflows/update-sh.yml
vendored
32
.github/workflows/update-sh.yml
vendored
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue