From 3454ca0df534faa0971b1b086569fdf5454fec1b Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 27 Dec 2023 20:31:11 +0100 Subject: [PATCH] Add GitHub Actions workflows for Elsa Docker images This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support. --- .github/workflows/elsa-server-and-studio.yml | 61 ++++++++++++++++++++ .github/workflows/elsa-server.yml | 61 ++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 .github/workflows/elsa-server-and-studio.yml create mode 100644 .github/workflows/elsa-server.yml diff --git a/.github/workflows/elsa-server-and-studio.yml b/.github/workflows/elsa-server-and-studio.yml new file mode 100644 index 000000000..bd6c23243 --- /dev/null +++ b/.github/workflows/elsa-server-and-studio.yml @@ -0,0 +1,61 @@ +name: Build and deploy Elsa Server + Studio reference application as Docker image +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + elsaworkflows/elsa-server-and-studio-v3 + flavor: | + latest=true + # generate Docker tags based on the following events/attributes + tags: | + type=sha + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v3 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./docker/ElsaServerAndStudio.Dockerfile + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/elsa-server.yml b/.github/workflows/elsa-server.yml new file mode 100644 index 000000000..a5bc9572a --- /dev/null +++ b/.github/workflows/elsa-server.yml @@ -0,0 +1,61 @@ +name: Build and deploy Elsa Server reference application as Docker image +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + elsaworkflows/elsa-server-v3 + flavor: | + latest=true + # generate Docker tags based on the following events/attributes + tags: | + type=sha + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v3 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./docker/ElsaServer.Dockerfile + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }}