|
1 | | -name: Deploy to dev(auth provider) |
| 1 | +name: Build-Deploy-devnet(auth-provider) |
2 | 2 | on: |
3 | 3 | push: |
4 | 4 | branches: [feature/vaccount_auth_provider] |
5 | 5 |
|
6 | | - |
7 | | - |
| 6 | +env: |
| 7 | + APP_NAME: velas-synapse-auth-provider |
| 8 | + APP_REPO: velas-synapse |
| 9 | + |
8 | 10 | jobs: |
9 | 11 | docker-build: |
10 | | - # Name the Job |
11 | 12 | name: Build and push |
12 | | - runs-on: build |
| 13 | + runs-on: devnet-services |
13 | 14 | outputs: |
14 | 15 | repository: ${{ steps.build.outputs.repository }} |
15 | 16 | image_tag: ${{ steps.build.outputs.image_tag }} |
16 | 17 | steps: |
17 | 18 | - uses: actions/checkout@v2 |
18 | | - - name: Login to Docker Hub |
19 | | - uses: docker/login-action@v2 |
20 | | - with: |
21 | | - username: ${{ secrets.REGISTRY_USER }} |
22 | | - password: ${{ secrets.REGISTRY_PASS }} |
23 | | - registry: ${{ secrets.REGISTRY_HOST }} |
24 | | - - name: Build, tag, and push image to AWS ECR |
| 19 | + - name: Build, tag, and push image |
25 | 20 | id: build |
26 | 21 | env: |
27 | | - REGISTRY: ${{ secrets.REGISTRY_HOST}}/velas |
28 | | - REPOSITORY: velas-synapse |
| 22 | + REGISTRY: ${{ secrets.REGISTRY_HOST }}/velas |
| 23 | + REPOSITORY: ${{ env.APP_REPO }} |
29 | 24 | IMAGE_TAG: ${{github.sha}} |
30 | 25 | run: | |
31 | 26 | docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --no-cache -f docker/Dockerfile . |
32 | 27 | docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG |
33 | 28 | deploy: |
34 | 29 | name: Deploy via Helmfile |
35 | | - runs-on: deployer |
| 30 | + runs-on: devnet-services |
36 | 31 | needs: docker-build |
37 | | - container: |
38 | | - image: quay.io/roboll/helmfile:v0.142.0 |
39 | 32 | steps: |
40 | | - - name: Install ssh |
41 | | - run: apk --update add openssh-client |
42 | 33 | - name: Check out velas-infra |
43 | 34 | uses: actions/checkout@master |
44 | 35 | with: |
45 | 36 | repository: velas/velas-infra |
46 | 37 | ref: master |
47 | 38 | ssh-key: ${{ secrets.SSH_KEY_INFRA }} |
48 | | - - uses: azure/k8s-set-context@v2 |
49 | | - with: |
50 | | - method: kubeconfig |
51 | | - kubeconfig: ${{ secrets.KUBE_CONFIG_DATA_EU_MONSTER1_RAW }} |
52 | | - context: "prod-eu-monster1" |
53 | | - - name: Sops Binary Installer |
54 | | - uses: mdgreenwald/[email protected] |
55 | | - |
56 | 39 | - name: Deploy via helmfile |
57 | 40 | id: deploy |
58 | 41 | env: |
59 | 42 | REGISTRY: ${{ secrets.REGISTRY_HOST }}/velas |
60 | | - REPOSITORY: velas-synapse |
| 43 | + REPOSITORY: ${{ env.APP_REPO }} |
61 | 44 | IMAGE_TAG: ${{github.sha}} |
62 | 45 | SOPS_AGE_KEY: ${{ secrets.INFRA_AGE }} |
63 | 46 | run: | |
64 | | - helm plugin install https://github.com/jkroepke/helm-secrets --version v3.11.0 || true |
65 | | - helm plugin install https://github.com/databus23/helm-diff || true |
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 |
| 47 | + cd deploy |
| 48 | + helmfile -e ${HELM_ENV} -l namespace=${NAMESPACE},name=${{ env.APP_NAME }} apply --set image.tag=$IMAGE_TAG,image.repository=$REGISTRY/$REPOSITORY --skip-deps |
0 commit comments