Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Update deployment workflow #2571

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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