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