From 00d7fa0f9f84cf065ea2d7a0065f225ed3fce32c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 18 Mar 2024 17:00:40 +0530 Subject: [PATCH] Using github vars for workflow directory --- .github/workflows/production_deployment.yml | 12 ++++++------ .github/workflows/staging_deployment.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/production_deployment.yml b/.github/workflows/production_deployment.yml index 1100faa..4bcd824 100644 --- a/.github/workflows/production_deployment.yml +++ b/.github/workflows/production_deployment.yml @@ -16,7 +16,7 @@ jobs: uses: fylein/docker-release-action@master env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} IMAGE_NAME: fyle_partner_dashboard-app - name: Install kustomize @@ -27,24 +27,24 @@ jobs: - name: Clone another repository uses: actions/checkout@v2 with: - repository: ${{ secrets.PROD_DEPLOY_REPO }} + repository: ${{ vars.PROD_DEPLOY_REPO }} ref: master - path: ${{ secrets.PROD_DEPLOY_REPO }} + path: ${{ vars.PROD_DEPLOY_REPO }} persist-credentials: false token: ${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }} - name: Update Image Tag run: | NEW_TAG="v$(git rev-parse --short HEAD)" - cd ${{ secrets.PROD_DEPLOY_REPO }}/${{ secrets.EKS_CLUSTER_NAME }}/integrations + cd ${{ vars.PROD_DEPLOY_REPO }}/${{ secrets.EKS_CLUSTER_NAME }}/integrations kustomize edit set image docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_partner_dashboard-app=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_partner_dashboard-app:$NEW_TAG - name: Commit and push changes run: | - cd ${{ secrets.PROD_DEPLOY_REPO }}/ + cd ${{ vars.PROD_DEPLOY_REPO }}/ git config --global user.email "integrations@fylehq.com" git config --global user.name "GitHub Actions" git add . git commit -m "Update image tag" - git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ secrets.PROD_DEPLOY_REPO }} + git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ vars.PROD_DEPLOY_REPO }} git push origin master diff --git a/.github/workflows/staging_deployment.yml b/.github/workflows/staging_deployment.yml index 43172be..8cb5484 100644 --- a/.github/workflows/staging_deployment.yml +++ b/.github/workflows/staging_deployment.yml @@ -20,7 +20,7 @@ jobs: uses: fylein/docker-release-action@master env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} IMAGE_NAME: fyle_partner_dashboard-app - name: Install kustomize @@ -31,24 +31,24 @@ jobs: - name: Clone another repository uses: actions/checkout@v2 with: - repository: ${{ secrets.STAGING_DEPLOY_REPO }} + repository: ${{ vars.STAGING_DEPLOY_REPO }} ref: master - path: ${{ secrets.STAGING_DEPLOY_REPO }} + path: ${{ vars.STAGING_DEPLOY_REPO }} persist-credentials: false token: ${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }} - name: Update Image Tag run: | NEW_TAG="v$(git rev-parse --short HEAD)" - cd ${{ secrets.STAGING_DEPLOY_REPO }}/${{ secrets.EKS_CLUSTER_NAME }}/integrations + cd ${{ vars.STAGING_DEPLOY_REPO }}/${{ vars.STAGING_DEPLOY_DIR }}/integrations kustomize edit set image docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_partner_dashboard-app=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_partner_dashboard-app:$NEW_TAG - name: Commit and push changes run: | - cd ${{ secrets.STAGING_DEPLOY_REPO }}/ + cd ${{ vars.STAGING_DEPLOY_REPO }}/ git config --global user.email "integrations@fylehq.com" git config --global user.name "GitHub Actions" git add . git commit -m "Update image tag" - git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ secrets.STAGING_DEPLOY_REPO }} + git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ vars.STAGING_DEPLOY_REPO }} git push origin master