mirror of
https://github.com/vxcontrol/soldr-modules.git
synced 2026-07-01 12:47:17 -04:00
Add workflow CI (#3)
* Add workflow * Print modules after put to DB * fix path to workflow yml file Co-authored-by: Dmitry Ng <19asdek91@gmail.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
name: 'Docker build'
|
||||
description: 'Build docker in workdir'
|
||||
inputs:
|
||||
docker_name:
|
||||
description: 'Name of creation docker image'
|
||||
required: true
|
||||
default: ''
|
||||
builddir:
|
||||
description: 'Name of creation docker image'
|
||||
required: false
|
||||
default: '.'
|
||||
docker_login:
|
||||
description: 'Login to docker hub'
|
||||
required: true
|
||||
default: ''
|
||||
docker_password:
|
||||
description: 'Password to docker hub'
|
||||
required: true
|
||||
default: ''
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Generate Docker tags
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
docker.io/vxcontrol/${{ inputs.docker_name }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
flavor: |
|
||||
latest=true
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ inputs.docker_login }}
|
||||
password: ${{ inputs.docker_password }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
context: ${{ inputs.builddir }}
|
||||
@@ -0,0 +1,23 @@
|
||||
name: VXModules build and push
|
||||
|
||||
on: workflow_call
|
||||
|
||||
jobs:
|
||||
build_and_push_docker:
|
||||
name: Docker Build and Publish
|
||||
environment:
|
||||
name: production
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Docker build dbmigrate
|
||||
uses: ./.github/actions/docker_build
|
||||
with:
|
||||
workdir: "build/package/dbmigrate"
|
||||
docker_name: "soldr-modules"
|
||||
docker_login: ${{ secrets.DOCKER_LOGIN }}
|
||||
docker_password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Docker build and push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
|
||||
jobs:
|
||||
# BUILD DOCKER
|
||||
build_docker_vxmodules:
|
||||
uses: ./.github/workflows/build-docker-modules.yml
|
||||
if: github.ref_name == 'master' || startsWith(github.ref, 'refs/tags')
|
||||
secrets: inherit
|
||||
@@ -57,4 +57,9 @@ echo "updating of modules secure config into global DB was complete"
|
||||
|
||||
echo "done"
|
||||
|
||||
GET_MODULES="SELECT name from modules;"
|
||||
MODULES=$(mysql -h"$DB_HOST" -P"$DB_PORT" -u"$DB_USER" -p"$DB_PASS" "$DB_NAME" -Nse "$GET_MODULES" 2>/dev/null)
|
||||
echo "List of modules in database: $MODULES"
|
||||
|
||||
|
||||
sleep infinity
|
||||
|
||||
Reference in New Issue
Block a user