Skip to content

Commit

Permalink
Update image-build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
lagougou authored Jan 27, 2024
1 parent 6dde6cf commit 9d76b81
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@ on:
- main
env:
AWS_REGION : "ap-southeast-1"
app: acorus
permissions:
id-token: write # This is required for requesting the JWT
id-token: write
contents: read
run-name: Build Image For Repo
jobs:
build:
permissions:
pull-requests: write
packages: write
contents: read
id-token: write
runs-on: ubuntu-latest
#runs-on: [self-hosted, Linux, X64, eks, mantle-default, "${{ github.event.inputs.env }}"]
outputs:
commit_sha: ${{ steps.get-commit-sha.outputs.commit_sha }}
ecr_registry: ${{ steps.login-ecr.outputs.registry }}
Expand All @@ -31,18 +26,16 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::942583694543:role/github-action-role
role-to-assume: arn:aws:iam::942583694543:role/github_assume_role
aws-region: ${{ env.AWS_REGION }}
role-session-name: samplerolesession
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Build Docker Image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPO: acorus
REPO: ${{ env.app }}
#REF: ${{ github.event.inputs.ref }}
COMMIT_SHA: ${{ steps.get-commit-sha.outputs.commit_sha }}
run: |
Expand All @@ -52,6 +45,25 @@ jobs:
docker push ${IMAGE_URL1}
- name: deploy app
run: |
helm template -f values.yaml charts
aws eks update-kubeconfig --name savour-layer3-eks
# echo 'KUBE_CONFIG_DATA<<EOF' >> $GITHUB_ENV
# echo $(cat /home/runner/.kube/config | base64) >> $GITHUB_ENV
# echo 'EOF' >> $GITHUB_ENV
HELM_OPTS="${HELM_OPTS} --set image.repository=${{ steps.login-ecr.outputs.registry }}/${{ env.app }}"
HELM_OPTS="${HELM_OPTS} --set image.tag=${{ steps.get-commit-sha.outputs.commit_sha }}"
helm template ${{ env.app }} -f values.yaml charts -n testnet-layer3 ${HELM_OPTS}
helm upgrade --install ${{ env.app }} -f values.yaml charts -n testnet-layer3 ${HELM_OPTS}
# - name: helm deploy
# uses: koslib/helm-eks-action@master
# env:
# KUBE_CONFIG_DATA: ${{ env.KUBE_CONFIG_DATA }}
# with:
# command: |
# HELM_OPTS="${HELM_OPTS} --set image.repository=${{ steps.login-ecr.outputs.registry }}/${{ env.app }}"
# HELM_OPTS="${HELM_OPTS} --set image.tag=${{ steps.get-commit-sha.outputs.commit_sha }}"
# helm template ${{ env.app }} -f values.yaml charts -n testnet-layer3 ${HELM_OPTS}
# helm upgrade --install ${{ env.app }} -f values.yaml charts -n testnet-layer3 ${HELM_OPTS}



0 comments on commit 9d76b81

Please sign in to comment.