|
8 | 8 | - "website/**"
|
9 | 9 |
|
10 | 10 | jobs:
|
11 |
| - cd: |
| 11 | + build-and-push: |
12 | 12 | runs-on: ubuntu-latest
|
| 13 | + outputs: |
| 14 | + TAG: ${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }} |
13 | 15 | steps:
|
14 | 16 | - uses: actions/checkout@v2
|
| 17 | + |
15 | 18 | - name: Declare some variables
|
16 | 19 | id: vars
|
17 | 20 | shell: bash
|
18 | 21 | run: |
|
19 | 22 | echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
20 | 23 | echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
| 24 | +
|
21 | 25 | - name: Docker login
|
22 | 26 | run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
|
| 27 | + |
23 | 28 | - name: Build and Push the Docker Image
|
24 | 29 | run: |
|
25 | 30 | docker build -t ${GITHUB_REPOSITORY}:${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }} .
|
26 | 31 | docker push ${GITHUB_REPOSITORY}:${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}
|
27 | 32 |
|
28 |
| - netlify-deploy: |
| 33 | + deploy: |
29 | 34 | 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 |
30 | 41 | 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 |
46 | 44 | 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