-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish docker images via GHA (#1134)
Co-authored-by: reivilibre <[email protected]>
- Loading branch information
1 parent
e0b951d
commit 888762f
Showing
4 changed files
with
94 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# GitHub actions workflow which builds and publishes the docker images. | ||
|
||
name: Build and deploy docker images | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build-sytest-images: | ||
name: "Build sytest:${{ matrix.tag }}" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- base_image: ubuntu:bionic | ||
tag: bionic | ||
- base_image: debian:buster | ||
tag: buster | ||
- base_image: debian:testing | ||
tag: testing | ||
steps: | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Inspect builder | ||
run: docker buildx inspect | ||
|
||
- name: Log in to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
pull: true | ||
push: true | ||
labels: "gitsha1=${{ github.sha }}" | ||
file: docker/base.Dockerfile | ||
build-args: "BASE_IMAGE=${{ matrix.base_image }}" | ||
tags: matrixdotorg/sytest:${{ matrix.tag }} | ||
|
||
build-dependent-images: | ||
needs: build-sytest-images | ||
name: "Build sytest-${{ matrix.dockerfile }}:${{ matrix.sytest_image_tag }}" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- sytest_image_tag: bionic | ||
dockerfile: synapse | ||
tags: "matrixdotorg/sytest-synapse:bionic" | ||
- sytest_image_tag: buster | ||
dockerfile: synapse | ||
tags: "matrixdotorg/sytest-synapse:buster" | ||
- sytest_image_tag: testing | ||
dockerfile: synapse | ||
tags: "matrixdotorg/sytest-synapse:testing" | ||
- sytest_image_tag: buster | ||
dockerfile: dendrite | ||
tags: "matrixdotorg/sytest-dendrite:go113,matrixdotorg/sytest-dendrite:latest" | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Inspect builder | ||
run: docker buildx inspect | ||
|
||
- name: Log in to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
pull: true | ||
push: true | ||
labels: "gitsha1=${{ github.sha }}" | ||
file: docker/base.Dockerfile | ||
build-args: "SYTEST_IMAGE_TAG=${{ matrix.base_image }}" | ||
tags: ${{ matrix.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.