Skip to content

Merge pull request #6 from mastodon/renovate/docker-login-action-3.x #15

Merge pull request #6 from mastodon/renovate/docker-login-action-3.x

Merge pull request #6 from mastodon/renovate/docker-login-action-3.x #15

name: Build container image
on:
push:
branches:
- "main"
tags:
- "*"
pull_request:
branches:
- "main"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Meta
id: "docker_meta"
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/mastodon/fastly-globeviz-data
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max