mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Merge pull request #8071 from ToolJet/docker-workflow-improvements
Docker workflow improvements
This commit is contained in:
commit
d47c27913f
2 changed files with 5 additions and 112 deletions
|
|
@ -8,11 +8,11 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
job-to-run:
|
||||
description: Enter the job name (tooljet-develop-image/tooljet-server-develop-image)
|
||||
options: ['tooljet-develop-image', 'tooljet-server-develop-image']
|
||||
description: Enter the job name (tooljet-develop-image)
|
||||
options: ["tooljet-develop-image"]
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
jobs:
|
||||
tooljet-develop-image:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
|
|
@ -63,56 +63,3 @@ jobs:
|
|||
run: |
|
||||
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-ce:develop"
|
||||
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL_OPS_CHANNEL }}
|
||||
|
||||
|
||||
|
||||
tooljet-server-develop-image:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
${{ github.ref == 'refs/heads/develop' }} &&
|
||||
${{ github.event_name == 'workflow_dispatch' && github.event.inputs.job-to-run == 'tooljet-server-develop-image' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: refs/heads/develop
|
||||
|
||||
# Create Docker Buildx builder with platform configuration
|
||||
- name: Set up Docker Buildx
|
||||
run: |
|
||||
mkdir -p ~/.docker/cli-plugins
|
||||
curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
||||
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
||||
docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
||||
docker buildx use mybuilder
|
||||
|
||||
- name: Set DOCKER_CLI_EXPERIMENTAL
|
||||
run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
|
||||
|
||||
- name: use mybuilder buildx
|
||||
run: docker buildx use mybuilder
|
||||
|
||||
- name: Docker Login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and Push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: docker/server.Dockerfile
|
||||
push: true
|
||||
tags: tooljet/tooljet-server-ce:develop
|
||||
platforms: linux/amd64
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Send Slack Notification on Failure
|
||||
if: failure()
|
||||
run: |
|
||||
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-server-ce:develop"
|
||||
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL_OPS_CHANNEL }}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ on:
|
|||
inputs:
|
||||
job-to-run:
|
||||
description: Enter the job name (tooljet-ce/tooljet-server-ce)
|
||||
options: ["tooljet-ce", "tooljet-server-ce"]
|
||||
options: ["tooljet-ce"]
|
||||
required: true
|
||||
image:
|
||||
description: "Enter the latest image tag"
|
||||
|
|
@ -68,7 +68,7 @@ jobs:
|
|||
|
||||
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
|
||||
# #Below code helps to trigger the workflow separately
|
||||
# #Below code helps to trigger the workflow separately
|
||||
|
||||
tooljet-ce:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -121,57 +121,3 @@ jobs:
|
|||
fi
|
||||
|
||||
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
|
||||
tooljet-server-ce:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.job-to-run == 'tooljet-server-ce' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: refs/heads/main
|
||||
|
||||
# Create Docker Buildx builder with platform configuration
|
||||
- name: Set up Docker Buildx
|
||||
run: |
|
||||
mkdir -p ~/.docker/cli-plugins
|
||||
curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
||||
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
||||
docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
||||
docker buildx use mybuilder
|
||||
|
||||
- name: Set DOCKER_CLI_EXPERIMENTAL
|
||||
run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
|
||||
|
||||
- name: use mybuilder buildx
|
||||
run: docker buildx use mybuilder
|
||||
|
||||
- name: Docker Login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and Push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: docker/server.Dockerfile
|
||||
push: true
|
||||
tags: tooljet/tooljet-server-ce:${{ github.event.inputs.image }},tooljet/tooljet-server-ce:latest
|
||||
platforms: linux/amd64
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Send Slack Notification
|
||||
run: |
|
||||
if [[ "${{ job.status }}" == "success" ]]; then
|
||||
message="Job '${{ env.JOB_NAME }}' succeeded! tooljet/tooljet-server-ce:${{ github.event.release.tag_name }}"
|
||||
else
|
||||
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-server-ce:${{ github.event.release.tag_name }}"
|
||||
fi
|
||||
|
||||
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue