openvk/.github/workflows/build.yaml
Artem Vetrov 677e147688
CI for OpenVK, Kubernetes and Docker deployments (#735)
* Kubernetes deployment

* Update kubernetes deployment

* Fix rewrite module load

* Fix mysql-primary bootstrap

* Fix mysql init-db apply order

* Fix init-db.sql permissions

* Fix MySQL missing *.sql import

* Switch from MySQL to MariaDB

* [skip ci] Example deployment update

* Set root app in chandler configmap

* Update missing php extension in base images

* Update missing dependency in apache image

* Remove default site configuration

* [skip ci] Split Kubernetes deployments by type

* Explicitly set persistent volume for openvk storage

* [skip ci] Add README for Kubernetes

* Replace old docker(-compose) files w/ new ones

* Add README for docker usage

* [skip ci] Update README.md and README_RU.md

* [skip ci] Fix eventdb DB name

* [skip ci] Kubernetes configmap: missing namespace

* [skip ci] Fix typo

* [skip ci] Ignore chandler.yml

* [skip ci] Missing /var/log/openvk volume

* [skip ci] Workaround for Docker <=20.10.6

* [skip ci] Handle permissions for apache2

* [skip ci] Initial Kafka support

* [skip ci] Kafka values for Kubernetes
2022-10-30 14:44:14 +03:00

64 lines
No EOL
2.1 KiB
YAML

name: Build images
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
BASE_IMAGE_NAME: openvk
DB_IMAGE_NAME: mariadb
EVENT_IMAGE_NAME: mariadb
DB_VERSION: "10.9"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: ['x86_64']
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
with:
lfs: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build base image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/$BASE_IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_ID:$VERSION . --push -f install/automated/docker/openvk.Dockerfile --build-arg GITREPO=${{ github.repository }}
- name: Build MariaDB primary image
run: |
IMAGE_NAME=ghcr.io/${{ github.repository }}/$DB_IMAGE_NAME:$DB_VERSION-primary
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME . --push -f install/automated/docker/mariadb-primary.Dockerfile --build-arg VERSION=$DB_VERSION
- name: Build MariaDB event image
run: |
IMAGE_NAME=ghcr.io/${{ github.repository }}/$EVENT_IMAGE_NAME:$DB_VERSION-eventdb
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME . --push -f install/automated/docker/mariadb-eventdb.Dockerfile --build-arg VERSION=$DB_VERSION