|
1 | 1 | name:Build |
2 | 2 |
|
3 | 3 | on: |
| 4 | +pull_request: |
4 | 5 | push: |
5 | 6 | branches: |
6 | 7 | -main |
7 | | -schedule:# Run everyday |
8 | | - -cron:"0 0 * * *" |
9 | | -pull_request: |
| 8 | +schedule: |
| 9 | +# every weekday |
| 10 | + -cron:'0 0 * * 1-5' |
| 11 | +# every sunday (no-cache) |
| 12 | + -cron:'0 0 * * 0' |
| 13 | +workflow_dispatch: |
| 14 | +inputs: |
| 15 | +no-cache: |
| 16 | +description:'Skip Docker cache' |
| 17 | +type:boolean |
| 18 | +default:false |
10 | 19 |
|
11 | 20 | jobs: |
12 | 21 | build: |
|
31 | 40 | -uses:docker/build-push-action@v3 |
32 | 41 | with: |
33 | 42 | context:${{ matrix.elixir }} |
| 43 | +pull:${{ github.event_name != 'pull_request' }} |
34 | 44 | push:${{ github.event_name != 'pull_request' }} |
35 | 45 | tags:articulate/articulate-elixir:${{ matrix.elixir }} |
36 | 46 | platforms:linux/amd64,linux/arm64/v8 |
37 | 47 | cache-from:type=registry,ref=articulate/articulate-elixir:${{ matrix.elixir }} |
38 | 48 | cache-to:type=inline |
| 49 | +no-cache:${{ github.event.schedule == '0 0 * * 0' || (github.event_name == 'workflow_dispatch' && inputs.no-cache) }} |