2021-11-12 06:18:29 +02:00
|
|
|
name: Build container image
|
|
|
|
on:
|
2021-11-16 22:42:14 +02:00
|
|
|
workflow_dispatch:
|
2021-11-12 06:18:29 +02:00
|
|
|
push:
|
|
|
|
branches:
|
2022-03-21 05:46:11 +02:00
|
|
|
- 'main'
|
2021-11-12 06:18:29 +02:00
|
|
|
tags:
|
2022-03-21 05:46:11 +02:00
|
|
|
- '*'
|
2022-02-14 17:08:02 +02:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- .github/workflows/build-image.yml
|
|
|
|
- Dockerfile
|
2022-09-08 10:44:24 +03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-11-12 06:18:29 +02:00
|
|
|
jobs:
|
|
|
|
build-image:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-06-19 08:38:07 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-06-20 12:52:12 +03:00
|
|
|
- uses: docker/setup-qemu-action@v2
|
2022-06-22 05:35:39 +03:00
|
|
|
- uses: docker/setup-buildx-action@v2
|
2022-06-20 12:52:36 +03:00
|
|
|
- uses: docker/login-action@v2
|
2021-11-12 06:18:29 +02:00
|
|
|
with:
|
2021-11-14 07:11:05 +02:00
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2022-02-23 17:44:16 +02:00
|
|
|
if: github.event_name != 'pull_request'
|
2022-06-19 08:39:21 +03:00
|
|
|
- uses: docker/metadata-action@v4
|
2021-11-12 06:18:29 +02:00
|
|
|
id: meta
|
|
|
|
with:
|
2021-11-14 07:11:05 +02:00
|
|
|
images: tootsuite/mastodon
|
2021-11-12 06:18:29 +02:00
|
|
|
flavor: |
|
2021-11-14 07:11:05 +02:00
|
|
|
latest=auto
|
2021-11-12 06:18:29 +02:00
|
|
|
tags: |
|
|
|
|
type=edge,branch=main
|
2022-10-10 01:32:40 +03:00
|
|
|
type=pep440,pattern={{raw}}
|
|
|
|
type=pep440,pattern=v{{major}}.{{minor}}
|
2022-02-23 17:44:16 +02:00
|
|
|
type=ref,event=pr
|
2022-06-19 08:40:46 +03:00
|
|
|
- uses: docker/build-push-action@v3
|
2021-11-12 06:18:29 +02:00
|
|
|
with:
|
|
|
|
context: .
|
2022-03-30 15:34:53 +03:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-02-14 17:08:02 +02:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
2021-11-12 06:18:29 +02:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
2022-10-10 01:32:40 +03:00
|
|
|
cache-from: type=registry,ref=tootsuite/mastodon:edge
|
2021-11-12 06:18:29 +02:00
|
|
|
cache-to: type=inline
|