-
Notifications
You must be signed in to change notification settings - Fork 16
77 lines (66 loc) · 2.17 KB
/
auto-updates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Auto Updates
on:
workflow_dispatch:
schedule:
- cron: '5 1 * * *'
- cron: '5 13 * * *'
#- cron: '15 */1 * * *'
jobs:
run-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
fetch-depth: 10
token: ${{ secrets.GITHUB_PAT }}
# Cache for Composer
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
# Cache for full update
- uses: actions/cache@v2
with:
path: ${{ github.workspace }}/tmp
key: ${{ runner.os }}-php-version-audit-${{ hashFiles('**/docs/rules-v1.json') }}
restore-keys: |
${{ runner.os }}-php-version-audit-
- name: Change origin to bypass gh-pages issues with actions
run: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_PAT }}@github.com/lightswitch05/php-version-audit.git
- name: Ensure latest commit with tags
run: git fetch; git fetch --tags --all; git checkout master; git pull
- name: Install dependencies
run: docker-compose run --rm composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Run Update
run: docker-compose run --rm php-version-audit --full-update --no-update --vvv
- name: commit updates
run: ./github-commit-auto-updates.sh
build:
runs-on: ubuntu-latest
needs: run-updates
strategy:
fail-fast: false
matrix:
TARGET:
- alpine
- buster
- bullseye
- bookworm
env:
TARGET: ${{matrix.TARGET}}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Tag and push all images
run: |
docker login --username=${{ secrets.DOCKERHUB_USER }} --password=${{ secrets.DOCKERHUB_PASS }}
./tag-and-push-images.sh ${TARGET}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_PAT }}