-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.64 KB
/
nightly.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }}