Skip to content

Commit 166dc49

Browse files
committed
update deploy
1 parent 17c0995 commit 166dc49

File tree

1 file changed

+24
-35
lines changed

1 file changed

+24
-35
lines changed

.github/workflows/build-deploy-devnet-auth-provider.yaml

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
branches: [feature/vaccount_auth_provider]
55

6+
7+
68
jobs:
79
docker-build:
810
# Name the Job
@@ -13,66 +15,53 @@ jobs:
1315
image_tag: ${{ steps.build.outputs.image_tag }}
1416
steps:
1517
- uses: actions/checkout@v2
16-
- name: Configure AWS credentials
17-
id: checkout
18-
uses: aws-actions/configure-aws-credentials@v1
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v2
1920
with:
20-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
21-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
22-
aws-region: ${{ secrets.AWS_REGION }}
23-
- name: Login to Amazon ECR
24-
id: login-ecr
25-
uses: aws-actions/amazon-ecr-login@v1
21+
username: ${{ secrets.REGISTRY_USER }}
22+
password: ${{ secrets.REGISTRY_PASS }}
23+
registry: ${{ secrets.REGISTRY_HOST }}
2624
- name: Build, tag, and push image to AWS ECR
2725
id: build
2826
env:
29-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
30-
ECR_REPOSITORY: velas-synapse
27+
REGISTRY: ${{ secrets.REGISTRY_HOST}}/velas
28+
REPOSITORY: velas-synapse
3129
IMAGE_TAG: ${{github.sha}}
3230
run: |
33-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --no-cache -f docker/Dockerfile .
34-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
35-
echo "::set-output name=repository::$ECR_REPOSITORY"
36-
echo "::set-output name=image_tag::$IMAGE_TAG"
37-
31+
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --no-cache -f docker/Dockerfile .
32+
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
3833
deploy:
3934
name: Deploy via Helmfile
4035
runs-on: deployer
4136
needs: docker-build
4237
container:
4338
image: quay.io/roboll/helmfile:v0.142.0
4439
steps:
45-
- name: Configure AWS credentials
46-
id: checkout
47-
uses: aws-actions/configure-aws-credentials@v1
48-
with:
49-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
50-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
51-
aws-region: ${{ secrets.AWS_REGION }}
40+
- name: Install ssh
41+
run: apk --update add openssh-client
5242
- name: Check out velas-infra
5343
uses: actions/checkout@master
5444
with:
5545
repository: velas/velas-infra
56-
token: ${{ secrets.INFRA_PULL_TOKEN }}
46+
ref: master
47+
ssh-key: ${{ secrets.SSH_KEY_INFRA }}
5748
- uses: azure/k8s-set-context@v2
5849
with:
5950
method: kubeconfig
60-
kubeconfig: ${{ secrets.KUBE_CONFIG_DATA_AWS_RAW }}
61-
context: "eks_prod-prod"
51+
kubeconfig: ${{ secrets.KUBE_CONFIG_DATA_EU_MONSTER1_RAW }}
52+
context: "prod-eu-monster1"
6253
- name: Sops Binary Installer
6354
uses: mdgreenwald/[email protected]
64-
- uses: prepor/action-aws-iam-authenticator@master
55+
- uses: adnsio/[email protected]
6556
- name: Deploy via helmfile
6657
id: deploy
6758
env:
68-
ECR_REPOSITORY: ${{ needs.docker-build.outputs.repository }}
69-
IMAGE_TAG: ${{ needs.docker-build.outputs.image_tag }}
70-
ECR_REGION: ${{ secrets.AWS_REGION }}
71-
NAMESPACE: devnet
59+
REGISTRY: ${{ secrets.REGISTRY_HOST }}/velas
60+
REPOSITORY: velas-synapse
61+
IMAGE_TAG: ${{github.sha}}
62+
SOPS_AGE_KEY: ${{ secrets.INFRA_AGE }}
7263
run: |
7364
helm plugin install https://github.com/jkroepke/helm-secrets --version v3.11.0 || true
7465
helm plugin install https://github.com/databus23/helm-diff || true
75-
cd deploy
76-
account_id=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .accountId)
77-
ECR_REGISTRY=${account_id}.dkr.ecr.${ECR_REGION}.amazonaws.com
78-
helmfile -e prod -l namespace=${NAMESPACE},name=velas-synapse-auth-provider apply --set image.tag=$IMAGE_TAG,image.repository=$ECR_REGISTRY/$ECR_REPOSITORY --skip-deps
66+
cd deploy/prod-eu-monster1
67+
helmfile -l namespace=devnet,name=velas-synapse-auth-provider apply --set image.tag=$IMAGE_TAG,image.repository=$REGISTRY/$REPOSITORY --skip-deps

0 commit comments

Comments
 (0)