Skip to content

Feature/improve encodings #5

Feature/improve encodings

Feature/improve encodings #5

Workflow file for this run

name: Create a tag and publish a Docker image
on:
pull_request:
branches:
- main
types: closed
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release_docker:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged && (contains(github.event.pull_request.labels.*.name, 'patch') || contains(github.event.pull_request.labels.*.name, 'minor') || contains(github.event.pull_request.labels.*.name, 'major')) }}
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Tag and prepare release
id: tag_and_prepare_release
uses: K-Phoen/[email protected]
with:
release_branch: main
release_strategy: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags:
type=semver,pattern={{version}},value=${{ steps.tag_and_prepare_release.outputs.tag }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
target: "prod"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
release_ui:
runs-on: [self-hosted,Linux,X64,gpu]
if: ${{ github.event.pull_request.merged && (contains(github.event.pull_request.labels.*.name, 'docs') || contains(github.event.pull_request.labels.*.name, 'patch') || contains(github.event.pull_request.labels.*.name, 'minor') || contains(github.event.pull_request.labels.*.name, 'major')) }}
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Startup
run: docker-compose --env-file .env.ci up -d serving develop web --build
- name: Install npm dependencies
run: docker-compose --env-file .env.ci run web npm install
- name: Wait for serving
run: docker-compose --env-file .env.ci exec develop koina_test.sh
- name: Update OpenAPI
run: docker-compose --env-file .env.ci exec develop python web/openapi/openapi_gen.py
- name: Build UI
run: docker-compose --env-file .env.ci run web npm run generate
- name: Copy folder content recursively to remote
uses: garygrossgarten/github-action-scp@release
with:
local: web/.output/public
remote: /var/www/koina/
host: ${{ secrets.WEBSERVER }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.PASSWORD }}
- name: Shutdown
if: always()
run: docker-compose --env-file .env.ci down
- name: Cleanup
if: always()
run: docker-compose --env-file .env.ci rm