CAPAUT-353 Add docker build
This commit is contained in:
@@ -8,12 +8,12 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) captica GmbH est. 2021
|
# Copyright (c) captica GmbH est. 2021
|
||||||
#
|
#
|
||||||
name: Example workflow
|
name: Java Build Workflow
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
jobs:
|
jobs:
|
||||||
Build:
|
build:
|
||||||
name: Java Build Job
|
name: Build java distribution
|
||||||
runs-on: nodejs-ubuntu
|
runs-on: nodejs-ubuntu
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
|
|||||||
50
.gitea/workflows/publish-docker-springboot.yaml
Normal file
50
.gitea/workflows/publish-docker-springboot.yaml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#
|
||||||
|
#
|
||||||
|
# Publish docker workflow for all modules of captica.expert
|
||||||
|
#
|
||||||
|
# Project: workflows
|
||||||
|
# Author: Marc Böhm <marc.boehm@captica.de>
|
||||||
|
# License: MIT License (see LICENSE.md)
|
||||||
|
#
|
||||||
|
# Copyright (c) captica GmbH est. 2021
|
||||||
|
#
|
||||||
|
name: Publish docker workflow for captica.expert modules
|
||||||
|
on:
|
||||||
|
workflow-call:
|
||||||
|
jobs:
|
||||||
|
publish_docker:
|
||||||
|
name: Create and publish docker image
|
||||||
|
runs-on: docker-ubuntu
|
||||||
|
if: gitea.ref == 'refs/heads/main'
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Downlod build artifacts (dist files)
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifacts-build
|
||||||
|
path: build/
|
||||||
|
- name: Setup docker buildx environment
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Login to docker registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ vars.CONTAINER_REGISTRY_URL }}
|
||||||
|
username: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
|
||||||
|
- name: Setup environment variables from "build/env-setup.sh"
|
||||||
|
run: |
|
||||||
|
source build/env-setup.sh
|
||||||
|
- name: Build and push docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: "${{ vars.CONTAINER_REGISTRY_URL }}/${{gitea.repository}}:latest"
|
||||||
|
build-args: |
|
||||||
|
FILE_BINARY=${{ env.CAPTICA_APPLICATION_FILE_BINARY }}
|
||||||
|
NAME_APPLICATION=${{ env.CAPTICA_APPLICATION_NAME }}
|
||||||
|
PORT_EXPOSURE=${{ env.CAPTICA_APPLICATION_PORT }}
|
||||||
|
JAVA_VERSION=${{ env.CAPTICA_APPLICATION_JAVA_VERSION }}
|
||||||
Reference in New Issue
Block a user