Skip to content

Commit

Permalink
Update workflows, merge repository kuzzle-containers
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Nov 28, 2023
1 parent cd72c10 commit 53e794b
Show file tree
Hide file tree
Showing 14 changed files with 526 additions and 194 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/core-dev.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: kuzzleio/core-dev

on:
push:
branches:
- master

env:
DOCKER_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"

jobs:
build-and-push:
name: Build and push core-dev image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- 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@v2
with:
context: ./core-dev
file: ./core-dev/Dockerfile
push: true
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/core-dev:2,kuzzleio/core-dev:latest
40 changes: 40 additions & 0 deletions .github/workflows/elasticsearch.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: kuzzleio/elasticsearch

on:
push:
branches:
- master

env:
DOCKER_PLATFORMS: "linux/amd64,linux/arm64"
ELASTICSEARCH_VERSION: "7.16.2"

jobs:
build-and-push:
name: Build and push elasticsearch image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- 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@v2
with:
context: ./elasticsearch
file: ./elasticsearch/Dockerfile
push: true
build-args: ELASTICSEARCH_VERSION=${{ env.ELASTICSEARCH_VERSION }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/elasticsearch:${{ env.ELASTICSEARCH_VERSION }},kuzzleio/elasticsearch:7, kuzzleio/elasticsearch:latest
101 changes: 101 additions & 0 deletions .github/workflows/kuzzle-runner.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: kuzzleio/kuzzle-runner

on:
push:
branches:
- master

env:
DOCKER_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
NODE_LTS_MAINTENANCE_VERSION: "16"
NODE_LTS_ACTIVE_VERSION: "18"
NODE_LTS_CURRENT_VERSION: "20"

jobs:
maintenance:
name: Build and deploy image embedding Node.js maintenance LTS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- 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@v3
with:
context: ./kuzzle-runner
file: ./kuzzle-runner/Dockerfile
push: true
build-args: NODE_LTS_VERSION=${{ env.NODE_LTS_MAINTENANCE_VERSION }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/kuzzle-runner:${{ env.NODE_LTS_MAINTENANCE_VERSION }},kuzzleio/kuzzle-runner:maintenance

active:
name: Build and deploy image embedding Node.js active LTS version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- 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@v3
with:
context: ./kuzzle-runner
file: ./kuzzle-runner/Dockerfile
push: true
build-args: NODE_LTS_VERSION=${{ env.NODE_LTS_ACTIVE_VERSION }}
platforms: ${{ env.DOCKER_PLATFORMS }}
tags: kuzzleio/kuzzle-runner:${{ env.NODE_LTS_ACTIVE_VERSION }},kuzzleio/kuzzle-runner:active,kuzzleio/kuzzle-runner:latest

# Node 20 is not currently supported, this will be uncommented in a upcomming PR
# current:
# name: Build and deploy image embedding Node.js latest LTS version
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - 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@v3
# with:
# context: ./kuzzle-runner
# file: ./kuzzle-runner/Dockerfile
# push: true
# build-args: NODE_LTS_VERSION=${{ env.NODE_LTS_CURRENT_VERSION }}
# platforms: ${{ env.DOCKER_PLATFORMS }}
# tags: kuzzleio/kuzzle-runner:${{ env.NODE_LTS_CURRENT_VERSION }},kuzzleio/kuzzle-runner:current
95 changes: 62 additions & 33 deletions .github/workflows/workflow-deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ on:
workflow_call:
inputs:
node_lts_maintenance_version:
description: "Current Node LTS Version"
description: "Maintenance Node LTS Version"
required: true
default: "16"
type: string
node_lts_current_version:
description: "Current Node LTS Version"
required: true
default: "20"
type: string

node_lts_active_version:
description: "Active Node LTS Version"
required: true
default: "18"
type: string

node_lts_current_version:
description: "Current Node LTS Version"
required: true
default: "20"
type: string

docker_platforms:
description: "Docker platforms"
required: true
Expand All @@ -30,31 +33,37 @@ on:
required: true
default: true
type: boolean

dockerhub_deploy:
description: "Deploy to DockerHub"
required: true
default: true
type: boolean

npm_deploy:
description: "Deploy to NPM"
required: true
default: true
type: boolean

node_lts_maintenance_version:
description: "Current Node LTS Version"
description: "Maintenance Node LTS Version"
required: true
default: "16"
type: string
node_lts_current_version:
description: "Current Node LTS Version"
required: true
default: "20"
type: string

node_lts_active_version:
description: "Active Node LTS Version"
required: true
default: "18"
type: string

node_lts_current_version:
description: "Current Node LTS Version"
required: true
default: "20"
type: string

docker_platforms:
description: "Docker platforms"
required: true
Expand All @@ -70,16 +79,18 @@ jobs:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master' || github.ref_name == '2-dev') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout project
uses: actions/checkout@v3

- name: Extract references from context
shell: bash
id: extract-refs
run: |
echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
- uses: convictional/[email protected]
echo "version=$(git describe --abbrev=0 --tags | cut -d. -f 1)" >> $GITHUB_OUTPUT
echo "repo=$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" >> $GITHUB_OUTPUT
- name: Trigger documentation workflow
uses: convictional/[email protected]
with:
owner: kuzzleio
repo: documentation
Expand All @@ -93,35 +104,43 @@ jobs:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.dockerhub_deploy) && github.ref_name == 'master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-packages
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_lts_maintenance_version }}
- uses: actions/cache@v3
- name: Checkout project
uses: actions/checkout@v3

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

- name: Setup Node version ${{ inputs.node_lts_active_version }}
uses: actions/setup-node@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
node-version: ${{ inputs.node_lts_active_version }}
cache: 'npm'

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

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

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

- name: Get current version from package.json
shell: bash
id: get-version
run: |
echo "::set-output name=version::$(jq -r .version package.json)"
echo "::set-output name=major-version::$(jq -r .version package.json | cut -d. -f 1)"
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 TS files
run: |
npm ci
npm run build
- name: Build and push
uses: docker/build-push-action@v2
with:
Expand All @@ -136,13 +155,23 @@ jobs:
if: ${{ (github.event_name != 'workflow_dispatch' || inputs.npm_deploy) && github.ref_name == 'master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout project
- uses: actions/checkout@v3
- uses: ./.github/actions/install-packages
- uses: actions/setup-node@v3

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

- name: Setup Node version ${{ inputs.node_lts_active_version }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_lts_maintenance_version }}
node-version: ${{ inputs.node_lts_active_version }}
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish
cache: 'npm'

- name: Install depedencies
run: npm ci

- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit 53e794b

Please sign in to comment.