Skip to content

Nigthly

Nigthly #220

Workflow file for this run

name: Nigthly
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: private
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_PREFIX: ${{ secrets.DOCKER_PREFIX }}
outputs:
DOCKER_TAG: ${{ steps.build.outputs.NIGHTLY_DOCKER_TAG }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- id: build
name: Build & Push Image
shell: bash
run: |
export DOCKER_TAG="latest"
NIGHTLY_DOCKER_TAG=nightly-`date -I`-`date +%s`
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
docker compose build
docker tag ${DOCKER_PREFIX}/icid-backend:${DOCKER_TAG} ${DOCKER_PREFIX}/icid-backend:${NIGHTLY_DOCKER_TAG}
docker push ${DOCKER_PREFIX}/icid-backend:${DOCKER_TAG}
docker push ${DOCKER_PREFIX}/icid-backend:${NIGHTLY_DOCKER_TAG}
docker rmi ${DOCKER_PREFIX}/icid-backend:${DOCKER_TAG}
docker rmi ${DOCKER_PREFIX}/icid-backend:${NIGHTLY_DOCKER_TAG}
echo "NIGHTLY_DOCKER_TAG=${NIGHTLY_DOCKER_TAG}" >> "${GITHUB_OUTPUT}"
deploy:
needs: build
uses: IndustryFusion/GitOpsRepo/.github/workflows/deploy.yaml@main
with:
APPS: icid
NAMESPACE: iff50
DOCKER_TAG: ${{ needs.build.outputs.DOCKER_TAG }}
CLUSTER: IFF-Dev-SmartFactory
secrets:
PRIVATE_GITHUB_TOKEN: ${{ secrets.PRIVATE_GITHUB_TOKEN }}
ICID_MONGO_URL_DEV: ${{ secrets.ICID_MONGO_URL_DEV }}
ICID_NAMESPACE: ${{ secrets.ICID_NAMESPACE }}