Skip to content

Docker

Docker #248

Workflow file for this run

name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `vfrinx2.0.3` tags as releases.
tags:
- vfrinx2*
workflow_dispatch:
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: frinx/conductor-server
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
build-image-v2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Build image
run: docker build . --file docker/server/Dockerfile --tag $IMAGE_NAME:latest --build-arg git_commit=$(git rev-parse HEAD)
- name: Log into docker hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
publish-latest-v2:
runs-on: ubuntu-latest
needs: build-image-v2
steps:
- name: Inspect latest image
run: docker image inspect $IMAGE_NAME:latest
# - name: Push latest image
# run: docker push $IMAGE_NAME:latest
publish-release-v2:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: build-image-v2
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed -e 's/^vfrinx//')
- name: Push release image
run: docker tag $IMAGE_NAME:latest $IMAGE_NAME:${{ steps.get_version.outputs.VERSION }}
- name: Inspect release image
run: docker image inspect $IMAGE_NAME:${{ steps.get_version.outputs.VERSION }}
# - name: Push release image
# run: docker push $IMAGE_ID:${{ steps.get_version.outputs.VERSION }}
swagger-v2:
runs-on: ubuntu-latest
needs: build-image-v2
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Run conductor image
run: docker run -t --network host --entrypoint '' $IMAGE_NAME:latest sleep infinity
- name: Setup upterm session
uses: lhotari/action-upterm@v1