2021-01-18 10:23:53 +00:00
|
|
|
# Based on https://github.com/docker/build-push-action
|
|
|
|
|
2021-01-18 12:24:23 +00:00
|
|
|
name: "Docker Hub"
|
2021-01-18 10:23:53 +00:00
|
|
|
|
|
|
|
on:
|
2021-01-18 12:24:23 +00:00
|
|
|
release:
|
|
|
|
types: [published]
|
2021-01-18 10:23:53 +00:00
|
|
|
|
|
|
|
env:
|
2021-01-18 13:37:49 +00:00
|
|
|
DOCKER_NAMESPACE: matrixdotorg
|
|
|
|
DOCKER_HUB_USER: neilalexander
|
2021-01-18 12:24:23 +00:00
|
|
|
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
|
2021-01-18 10:23:53 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-01-18 12:24:23 +00:00
|
|
|
Monolith:
|
2021-01-18 10:23:53 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-18 12:24:23 +00:00
|
|
|
- name: Checkout
|
2021-01-18 10:23:53 +00:00
|
|
|
uses: actions/checkout@v2
|
2021-01-18 12:24:23 +00:00
|
|
|
- name: Get release tag
|
2021-01-18 10:23:53 +00:00
|
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
2021-01-18 12:24:23 +00:00
|
|
|
- name: Set up QEMU
|
2021-01-18 10:23:53 +00:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2021-01-18 12:24:23 +00:00
|
|
|
- name: Set up Docker Buildx
|
2021-01-18 10:23:53 +00:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2021-01-18 12:24:23 +00:00
|
|
|
- name: Login to Docker Hub
|
2021-01-18 10:23:53 +00:00
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ env.DOCKER_HUB_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
2021-01-18 12:24:23 +00:00
|
|
|
|
|
|
|
- name: Build monolith image
|
2021-01-18 10:23:53 +00:00
|
|
|
id: docker_build_monolith
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./build/docker/Dockerfile.monolith
|
2021-01-18 12:24:23 +00:00
|
|
|
platforms: ${{ env.PLATFORMS }}
|
2021-01-18 10:23:53 +00:00
|
|
|
push: true
|
|
|
|
tags: |
|
2021-01-18 13:37:49 +00:00
|
|
|
${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:latest
|
|
|
|
${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:${{ env.RELEASE_VERSION }}
|
2021-01-18 12:24:23 +00:00
|
|
|
|
|
|
|
Polylith:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Get release tag
|
|
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ env.DOCKER_HUB_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build polylith image
|
2021-01-18 10:23:53 +00:00
|
|
|
id: docker_build_polylith
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./build/docker/Dockerfile.polylith
|
2021-01-18 12:24:23 +00:00
|
|
|
platforms: ${{ env.PLATFORMS }}
|
2021-01-18 10:23:53 +00:00
|
|
|
push: true
|
|
|
|
tags: |
|
2021-01-18 13:37:49 +00:00
|
|
|
${{ env.DOCKER_NAMESPACE }}/dendrite-polylith:latest
|
|
|
|
${{ env.DOCKER_NAMESPACE }}/dendrite-polylith:${{ env.RELEASE_VERSION }}
|