Skip to content

Commit

Permalink
Updated CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ivnglkv committed Mar 3, 2024
1 parent ba2f919 commit f65a410
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 141 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/.release-workflow-rc.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/.release-workflow.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: JDI QASP dev build workflow

on:
push:
branches:
- develop

jobs:
version-update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Increment version
run: |
cd model/version
OLD_VERSION=$(ls)
FIRST_DIGIT=$(echo $OLD_VERSION | cut -d '.' -f 1)
SECOND_DIGIT=$(echo $OLD_VERSION | cut -d '.' -f 2)
THIRD_DIGIT=$(echo $OLD_VERSION | cut -d '.' -f 3)
NEW_THIRD_DIGIT=$((THIRD_DIGIT+1))
NEW_VERSION=$FIRST_DIGIT.$SECOND_DIGIT.$NEW_THIRD_DIGIT
mv ./$OLD_VERSION ./$NEW_VERSION
cd ../..
- name: Commit incremented version
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Increment version
branch: develop
lint:
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-compose.dev.yaml
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: false
- name: Lint
run: docker compose run api make lint
build:
needs: [version-update, lint]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up default environment
run: cp .env.dist .env
- name: Build Docker image
uses: ./.github/workflows/docker-image-update.yml
46 changes: 46 additions & 0 deletions .github/workflows/docker-image-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: JDI QASP Docker image build workflow

on:
workflow_call:
push:
tags:
- *
pull_request_target:
branches:
- master

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/jdi-testing/jdi-qasp-ml
labels: |
maintainer=github.com/jdi-testing
org.opencontainers.image.title=JDI QASP ML
org.opencontainers.image.description=Backend for JDN Chrome plugin
tags: |
type=ref,event=branch,enable=${{ {{branch}} != 'master' }}
type=ref,event=pr,prefix
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
11 changes: 0 additions & 11 deletions .github/workflows/release-rc-version.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/release-rest-version.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/release-stable-version.yml

This file was deleted.

0 comments on commit f65a410

Please sign in to comment.