Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Using github vars for workflow directory #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/production_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_qbo-app-2

- name: Install kustomize
Expand All @@ -27,25 +27,25 @@ 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_qbo-app-2=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_qbo-app-2:$NEW_TAG

- name: Commit and push changes
run: |
cd ${{ secrets.PROD_DEPLOY_REPO }}/
cd ${{ vars.PROD_DEPLOY_REPO }}/
git config --global user.email "[email protected]"
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 pull origin master
git push origin master
12 changes: 6 additions & 6 deletions .github/workflows/staging_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_qbo-app-2

- name: Install kustomize
Expand All @@ -31,25 +31,25 @@ 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_qbo-app-2=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_qbo-app-2:$NEW_TAG

- name: Commit and push changes
run: |
cd ${{ secrets.STAGING_DEPLOY_REPO }}/
cd ${{ vars.STAGING_DEPLOY_REPO }}/
git config --global user.email "[email protected]"
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 pull origin master
git push origin master
Loading