Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild tags daily #429

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,20 @@ on:
- main
tags:
- '*'
workflow_call:
inputs:
context:
type: string
required: false
description: context passed to docker/build-push-action (optional)
tags:
type: string
required: false
description: tags passed to docker/metadata-action (optional)

jobs:
build:
uses: ./.github/workflows/reusable--build.yaml
permissions:
contents: read
packages: write
with:
context: ${{ inputs.context }}
tags: ${{ inputs.tags }}

build-ubuntu20:
uses: ./.github/workflows/reusable--build.yaml
permissions:
contents: read
packages: write
with:
context: ${{ inputs.context }}
tags: ${{ inputs.tags }}
file: Dockerfile.ubuntu20
flavor: suffix=-ubuntu20

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/rebuild-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: rebuild-tags

on:
pull_request:
paths:
- .github/workflows/build-tags.yaml
- .github/workflows/reusable--build.yaml
push:
paths:
- .github/workflows/build-tags.yaml
- .github/workflows/reusable--build.yaml
schedule:
- cron: '21 0 * * *' # 7:00 Asia/Tokyo

jobs:
build:
strategy:
fail-fast: false
matrix:
tag:
- 2.317.0
uses: ./.github/workflows/reusable--build.yaml
permissions:
contents: read
packages: write
with:
context: ${{ github.server_url }}/${{ github.repository }}.git#refs/tags/${{ matrix.tag }}
tags: ${{ matrix.tag }}
push: ${{ github.event_name != 'pull_request' }}
disable-build-cache: true

build-ubuntu20:
strategy:
fail-fast: false
matrix:
tag:
- 2.317.0
uses: ./.github/workflows/reusable--build.yaml
permissions:
contents: read
packages: write
with:
context: ${{ github.server_url }}/${{ github.repository }}.git#refs/tags/${{ matrix.tag }}
tags: ${{ matrix.tag }}
file: Dockerfile.ubuntu20
flavor: suffix=-ubuntu20
push: ${{ github.event_name != 'pull_request' }}
disable-build-cache: true
14 changes: 12 additions & 2 deletions .github/workflows/reusable--build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ on:
type: string
required: false
description: flavor passed to docker/metadata-action
push:
type: boolean
required: false
default: true
description: push passed to docker/build-push-action
disable-build-cache:
type: boolean
required: false
description: Set true to disable the build cache
outputs:
image-uri:
value: ${{ jobs.build.outputs.image-uri }}
Expand All @@ -48,7 +57,8 @@ jobs:
images: ghcr.io/${{ github.repository }}
tags: ${{ inputs.tags }}
flavor: ${{ inputs.flavor }}
- uses: int128/docker-build-cache-config-action@0b4582921757b6145fd7fab8156c725b28e1c2b8 # v1.31.0
- if: inputs.disable-build-cache != true
uses: int128/docker-build-cache-config-action@0b4582921757b6145fd7fab8156c725b28e1c2b8 # v1.31.0
id: cache
with:
image: ghcr.io/${{ github.repository }}/cache
Expand All @@ -60,7 +70,7 @@ jobs:
with:
context: ${{ inputs.context }}
file: ${{ inputs.file }}
push: true
push: ${{ inputs.push }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
Expand Down