Skip to content

Commit 29cedf5

Browse files
Jonsy13imrajdas
andauthored
Updated pipeline for automating docs deployment (#179)
* Updated pipeline for automating docs deployment Signed-off-by: Jonsy13 <[email protected]> * Updated user to litmusbot Signed-off-by: Jonsy13 <[email protected]> * Update docker_Push.yml Co-authored-by: Raj Babu Das <[email protected]>
1 parent 3150db3 commit 29cedf5

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

.github/workflows/docker_Push.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,54 @@ on:
88
- "website/**"
99

1010
jobs:
11-
cd:
11+
build-and-push:
1212
runs-on: ubuntu-latest
13+
outputs:
14+
TAG: ${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}
1315
steps:
1416
- uses: actions/checkout@v2
17+
1518
- name: Declare some variables
1619
id: vars
1720
shell: bash
1821
run: |
1922
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
2023
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
24+
2125
- name: Docker login
2226
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
27+
2328
- name: Build and Push the Docker Image
2429
run: |
2530
docker build -t ${GITHUB_REPOSITORY}:${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }} .
2631
docker push ${GITHUB_REPOSITORY}:${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}
2732
28-
netlify-deploy:
33+
deploy:
2934
runs-on: ubuntu-latest
35+
needs:
36+
- build-and-push
37+
defaults:
38+
run:
39+
shell: bash
40+
working-directory: k8s-infra/litmus-docs/base
3041
steps:
31-
- uses: actions/checkout@v2
32-
- name: Use Node.js 12.x
33-
uses: actions/setup-node@v1
34-
with:
35-
node-version: 12.x
36-
# Run npm install and build on our code
37-
- run: |
38-
cd website
39-
npm install
40-
npm run build
41-
# Deploy to Netlify using our production secrets
42-
- uses: netlify/actions/cli@master
43-
env:
44-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
45-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
42+
- name: Checking out CD repository
43+
uses: actions/checkout@v2
4644
with:
47-
args: deploy --dir=website/build --prod
45+
ref: "master"
46+
repository: litmuschaos/litmus-cd
47+
token: ${{ secrets.CD_PUSH_TOKEN }}
48+
49+
- name: Updating the manifests and pushing
50+
run: |
51+
tag=${{ needs.build-and-push.outputs.TAG }}
52+
53+
# Deployment Images Update
54+
sed -i -e "s|litmuschaos/litmus-docs:.*|litmuschaos/litmus-docs:$tag|g" litmusdocs-deploy.yaml
55+
56+
git config user.name litmuschaos-bot
57+
git config user.email [email protected]
58+
git add .
59+
git commit -m "Manifest updated for litmus-docs"
60+
git push origin master
61+

0 commit comments

Comments
 (0)