2021-11-12 13:18:29 +09:00
|
|
|
name: Build container image
|
|
|
|
on:
|
2021-11-17 05:42:14 +09:00
|
|
|
workflow_dispatch:
|
2021-11-12 13:18:29 +09:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
tags:
|
|
|
|
- "*"
|
2022-02-15 00:08:02 +09:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- .github/workflows/build-image.yml
|
|
|
|
- Dockerfile
|
2021-11-12 13:18:29 +09:00
|
|
|
jobs:
|
|
|
|
build-image:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-02-06 01:29:54 +09:00
|
|
|
- uses: docker/setup-qemu-action@v1
|
2021-11-12 13:18:29 +09:00
|
|
|
- uses: docker/setup-buildx-action@v1
|
|
|
|
- uses: docker/login-action@v1
|
|
|
|
with:
|
2021-11-14 14:11:05 +09:00
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-11-12 13:18:29 +09:00
|
|
|
- uses: docker/metadata-action@v3
|
|
|
|
id: meta
|
|
|
|
with:
|
2021-11-14 14:11:05 +09:00
|
|
|
images: tootsuite/mastodon
|
2021-11-12 13:18:29 +09:00
|
|
|
flavor: |
|
2021-11-14 14:11:05 +09:00
|
|
|
latest=auto
|
2021-11-12 13:18:29 +09:00
|
|
|
tags: |
|
|
|
|
type=edge,branch=main
|
|
|
|
type=semver,pattern={{ raw }}
|
|
|
|
- uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2022-02-06 01:29:54 +09:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-02-15 00:08:02 +09:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
2021-11-12 13:18:29 +09:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
2021-11-14 14:11:05 +09:00
|
|
|
cache-from: type=registry,ref=tootsuite/mastodon:latest
|
2021-11-12 13:18:29 +09:00
|
|
|
cache-to: type=inline
|