Skip to content

Commit

Permalink
Merge dev in master (#259)
Browse files Browse the repository at this point in the history
* Add new UNG CI

* increase mariadb health timeout in CI test stage

* Remove slatify from CI

* Add registry URL to CI config

* Add registry to push CI

* Fix REGISTRY_URL on CI
  • Loading branch information
Blendman974 authored Nov 24, 2024
1 parent 6474f52 commit 4ec421f
Showing 1 changed file with 21 additions and 30 deletions.
51 changes: 21 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
node-version: [18]
Expand All @@ -26,7 +26,7 @@ jobs:
- run: pnpm lint

build:
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
node-version: [18]
Expand All @@ -45,7 +45,7 @@ jobs:
- run: pnpm build

test:
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
node-version: [18]
Expand All @@ -63,10 +63,10 @@ jobs:

ports:
- 3306:3306
options: --name mariadb --health-cmd="mysqladmin ping" --health-interval=1s --health-timeout=5s --health-retries=3
options: --name mariadb --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=30s --health-retries=5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- build
- test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
Expand All @@ -116,33 +116,24 @@ jobs:

deploy:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
runs-on: self-hosted
needs:
- lint
- build
- test
env:
RESOURCE_NAME: ${{ github.ref == 'refs/heads/master' && 'prod-api' || 'dev-api' }}
steps:
- uses: actions/checkout@v2
- name: Install oc
uses: redhat-actions/oc-installer@v1
with:
oc_version: '4.6'
- name: Login to OKD
run: oc login --token=${{ secrets.OKD_TOKEN }} --server=${{ secrets.OKD_SERVER }}

- name: Change the project
run: oc project ${{ secrets.OKD_PROJECT }}

- name: Start the build
run: oc start-build ${{ env.RESOURCE_NAME }} --follow

- uses: lazy-actions/slatify@master
if: always()
- uses: actions/checkout@v4
- name: Install docker
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
type: ${{ job.status }}
job_name: '*Deployment to ${{ env.RESOURCE_NAME }}*'
commit: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}
token: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: |
${{ secrets.REGISTRY_URL }}/uttarena/api:${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}

0 comments on commit 4ec421f

Please sign in to comment.