Skip to content

Commit

Permalink
ci(build): allow cache to be bypassed
Browse files Browse the repository at this point in the history
Every week build without cache and allow a manual run as well
  • Loading branch information
mloberg committed Jan 27, 2023
1 parent c707772 commit 53f3488
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
name: Build

on:
pull_request:
push:
branches:
- main
schedule: # Run everyday
- cron: "0 0 * * *"
pull_request:
schedule:
# every weekday
- cron: '0 0 * * 1-5'
# every sunday (no-cache)
- cron: '0 0 * * 0'
workflow_dispatch:
inputs:
no-cache:
description: 'Skip Docker cache'
type: boolean
default: false

jobs:
build:
Expand All @@ -31,8 +40,10 @@ jobs:
- uses: docker/build-push-action@v3
with:
context: ${{ matrix.elixir }}
pull: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' }}
tags: articulate/articulate-elixir:${{ matrix.elixir }}
platforms: linux/amd64,linux/arm64/v8
cache-from: type=registry,ref=articulate/articulate-elixir:${{ matrix.elixir }}
cache-to: type=inline
no-cache: ${{ github.event.schedule == '0 0 * * 0' || (github.event_name == 'workflow_dispatch' && inputs.no-cache) }}

0 comments on commit 53f3488

Please sign in to comment.