2023-04-19 10:20:25 -07:00
|
|
|
name: Build nightly container image
|
|
|
|
on:
|
2023-04-19 12:46:31 -07:00
|
|
|
workflow_dispatch:
|
2023-04-19 10:20:25 -07:00
|
|
|
schedule:
|
|
|
|
- cron: '0 2 * * *' # run at 2 AM UTC
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-nightly-image:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: hadolint/hadolint-action@v3.1.0
|
|
|
|
- uses: docker/setup-qemu-action@v2
|
|
|
|
- uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Log in to the Github Container registry
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- uses: docker/metadata-action@v4
|
|
|
|
id: meta
|
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
ghcr.io/mastodon/mastodon
|
|
|
|
flavor: |
|
|
|
|
latest=auto
|
|
|
|
tags: |
|
|
|
|
type=raw,value=nightly
|
2023-04-25 14:11:31 -07:00
|
|
|
type=schedule,pattern=nightly-{{date 'YYYY-MM-DD' tz='Etc/UTC'}}
|
2023-04-19 10:20:25 -07:00
|
|
|
labels: |
|
|
|
|
org.opencontainers.image.description=Nightly build image used for testing purposes
|
|
|
|
|
2023-05-04 04:45:39 -07:00
|
|
|
- name: Generate version suffix
|
|
|
|
id: version_vars
|
|
|
|
run: |
|
2023-05-05 09:58:35 -07:00
|
|
|
echo mastodon_version_suffix=+nightly-$(date +'%Y%m%d') >> $GITHUB_OUTPUT
|
2023-05-04 04:45:39 -07:00
|
|
|
|
2023-04-19 10:20:25 -07:00
|
|
|
- uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
2023-05-04 04:45:39 -07:00
|
|
|
build-args: MASTODON_VERSION_SUFFIX=${{ steps.version_vars.outputs.mastodon_version_suffix }}
|
2023-04-19 10:20:25 -07:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
provenance: false
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
push: ${{ github.repository == 'mastodon/mastodon' && github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|