-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (60 loc) · 1.74 KB
/
ci-docker-cache.yml
File metadata and controls
66 lines (60 loc) · 1.74 KB
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
name: ci-docker-cache-warm
# Build Docker complet sans push pour vérifier le container et alimenter le cache GHA.
# Ce workflow ne produit pas d'artefact promu vers staging.
on:
push:
branches: [dev]
pull_request:
branches: [dev]
permissions:
contents: read
concurrency:
group: ci-docker-cache-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
code:
- 'app/**'
- 'bin/**'
- 'config/**'
- 'db/**'
- 'lib/**'
- 'public/**'
- 'spec/**'
- 'Gemfile'
- 'Gemfile.lock'
- 'package.json'
- 'yarn.lock'
- 'Procfile*'
- 'tailwind.config.js'
- 'Dockerfile*'
- '.rubocop.yml'
- '.ruby-version'
- '.node-version'
- 'config.ru'
- 'Rakefile'
- '.github/workflows/**'
docker-cache-warm:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: docker/setup-buildx-action@v4
- name: Warm Docker cache with a full build check
uses: docker/build-push-action@v7
with:
context: .
push: false
build-args: RUBY_VERSION=4.0.1
cache-from: type=gha,scope=docker-${{ hashFiles('Gemfile.lock') }}
cache-to: type=gha,mode=max,scope=docker-${{ hashFiles('Gemfile.lock') }}