mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
b993bc0955
This is based on https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ which doesn't use QEMU
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
name: Container Image
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
tags: [ 'v*' ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
REGISTRY: ghcr.io
|
|
|
|
jobs:
|
|
push:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Log into registry ${{ env.REGISTRY }}
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|