Skip to content

Commit

Permalink
Merge pull request #2571 from kuzzleio/beta
Browse files Browse the repository at this point in the history
Release: Update deployment workflow
  • Loading branch information
rolljee authored Dec 31, 2024
2 parents 6dbfc99 + 3c4c211 commit 3526a37
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 195 deletions.
199 changes: 199 additions & 0 deletions .github/workflows/release.workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: Release workflow

env:
DOCKER_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
DOCKER_PLATFORMS_ELASTICSEARCH: "linux/amd64,linux/arm64"
ELASTICSEARCH_VERSION: "7.17.26"
NODE_VERSION: "20"

on:
release:
types:
- released

jobs:
publish-runner:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master') }}
name: Kuzzle runner Docker image
needs: [npm-deploy]
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [16, 18, 20]
steps:
- uses: actions/checkout@v4

- name: Install additional libraries
uses: ./.github/actions/install-packages

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./docker/images/kuzzle-runner
file: ./docker/images/kuzzle-runner/Dockerfile
push: true
build-args: NODE_VERSION=${{ matrix.node-version }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/kuzzle-runner:${{ matrix.node-version }}

publish-plugin-dev:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master') }}
name: Kuzzle plugin-dev Docker image
needs: [npm-deploy]
runs-on: ubuntu-24.04
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Install additional libraries
uses: ./.github/actions/install-packages

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Get current version from package.json
shell: bash
id: get-version
run: |
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
echo "major-version=$(jq -r .version package.json | cut -d. -f 1)" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/images/plugin-dev/Dockerfile
push: true
build-args: NODE_VERSION=${{ env.NODE_VERSION }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/plugin-dev:${{ steps.get-version.outputs.major-version }},kuzzleio/plugin-dev:latest,kuzzleio/plugin-dev:${{ steps.get-version.outputs.version }}

publish-kuzzle-core:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master') }}
name: Kuzzle core Docker image
needs: [npm-deploy]
runs-on: ubuntu-24.04
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Install additional libraries
uses: ./.github/actions/install-packages

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Get current version from package.json
shell: bash
id: get-version
run: |
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
echo "major-version=$(jq -r .version package.json | cut -d. -f 1)" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/images/kuzzle/Dockerfile
push: true
build-args: NODE_VERSION=${{ env.NODE_VERSION }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/kuzzle:${{ steps.get-version.outputs.major-version }},kuzzleio/kuzzle:latest,kuzzleio/kuzzle:${{ steps.get-version.outputs.version }}

publish-core-dev:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master') }}
name: Kuzzle core-dev Docker image
needs: [npm-deploy]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install additional libraries
uses: ./.github/actions/install-packages

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./docker/images/core-dev
file: ./docker/images/core-dev/Dockerfile
push: true
build-args: NODE_VERSION=${{ env.NODE_VERSION }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/core-dev:2,kuzzleio/core-dev:latest

publish-elasticsearch:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master') }}
name: Elasticsearch Docker image
needs: [npm-deploy]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install additional libraries
uses: ./.github/actions/install-packages

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./docker/images/elasticsearch
file: ./docker/images/elasticsearch/Dockerfile
push: true
build-args: ELASTICSEARCH_VERSION=${{ env.ELASTICSEARCH_VERSION }}
platforms: ${{ env.DOCKER_PLATFORMS_ELASTICSEARCH }}
tags: kuzzleio/elasticsearch:${{ env.ELASTICSEARCH_VERSION }},kuzzleio/elasticsearch:7, kuzzleio/elasticsearch:latest
Loading

0 comments on commit 3526a37

Please sign in to comment.