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