Skip to content

Commit

Permalink
chore: removing vc-api (#185)
Browse files Browse the repository at this point in the history
* chore: removing E2E tests

* chore: removing `apps/vc-api`

* chore: removing `vc-api` deployment

* chore: adding `Build and deploy VC-API` workflow (#186)
  • Loading branch information
artursudnik authored Oct 16, 2023
1 parent 1a0a3ad commit a11ae07
Show file tree
Hide file tree
Showing 169 changed files with 78 additions and 17,625 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/deploy-vc-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and deploy VC-API

on: [workflow_dispatch]

jobs:
cancel-previous:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

install-build-and-push:
runs-on: ubuntu-latest
needs: [cancel-previous]
steps:
- name: Check out vc-api-owf
run: |
git clone https://github.com/energywebfoundation/vc-api-owf
- name: Configure AWS credentials IDC
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr-ssi
uses: aws-actions/amazon-ecr-login@v2

- name: Getting GIT SHA value
id: get-git-sha
working-directory: ./vc-api-owf
run: echo "git-sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Build Docker image
working-directory: ./vc-api-owf
env:
ECR_REGISTRY: ${{ steps.login-ecr-ssi.outputs.registry }}
AWS_ECR_REPOSITORY_SSI: ${{ secrets.DEV_ECR_REPOSITORY }}
GIT_SHA: ${{ steps.get-git-sha.outputs.git-sha }}
run: |
docker build \
-t $ECR_REGISTRY/$AWS_ECR_REPOSITORY_SSI:$GIT_SHA \
-f apps/vc-api/Dockerfile .
- name: Push Docker image
working-directory: ./vc-api-owf
env:
ECR_REGISTRY: ${{ steps.login-ecr-ssi.outputs.registry }}
AWS_ECR_REPOSITORY_SSI: ${{ secrets.DEV_ECR_REPOSITORY }}
GIT_SHA: ${{ steps.get-git-sha.outputs.git-sha }}
run: |
docker push \
$ECR_REGISTRY/$AWS_ECR_REPOSITORY_SSI:$GIT_SHA
- name: Logout of Amazon ECR
if: always()
run: docker logout ${{ steps.login-ecr-idc.outputs.registry }}


- name: ARGO CD LOGIN
uses: clowdhaus/argo-cd-action/@v1.9.0
id: argocd_login_ssi
with:
command: login ${{ secrets.DEV_ARGOCD_URL }}
options: --insecure --password ${{ secrets.DEV_ARGOCD_PASS }} --username ${{ secrets.DEV_ARGOCD_USERNAME }}

- name: ArgoCD overvrite SSI values.yaml
uses: clowdhaus/argo-cd-action/@v1.9.0
id: argocd_image_tag_overwrite_ssi
with:
command: app set ssi-wallet
options: -p image.tag=${{ steps.get-git-sha.outputs.git-sha }}
36 changes: 0 additions & 36 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,6 @@ jobs:
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

- name: Configure AWS credentials SSI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ steps.env_vars.outputs.aws_access_key_id_ssi }}
aws-secret-access-key: ${{ steps.env_vars.outputs.aws_secret_key_ssi }}
aws-region: ${{ steps.env_vars.outputs.aws_region }}

- name: Login to Amazon ECR
id: login-ecr-ssi
uses: aws-actions/amazon-ecr-login@v1

- name: Build & push docker SSI images
env:
BUILD_ID: ${{ steps.tag_version.outputs.new_tag }}
ECR_REGISTRY: ${{ steps.login-ecr-ssi.outputs.registry }}
run: |
docker build -t $ECR_REGISTRY/${{ steps.env_vars.outputs.aws_ecr_repository_ssi }}:$BUILD_ID -f apps/vc-api/Dockerfile .
docker push $ECR_REGISTRY/${{ steps.env_vars.outputs.aws_ecr_repository_ssi }}:$BUILD_ID
- name: Logout of Amazon ECR
if: always()
run: docker logout ${{ steps.login-ecr-ssi.outputs.registry }}

- name: Deploy SSI
uses: clowdhaus/argo-cd-action/@v1.9.0
id: argocd_login_ssi
with:
command: login ${{ steps.env_vars.outputs.argocd_url }}
options: --insecure --password ${{ steps.env_vars.outputs.argocd_password }} --username ${{ steps.env_vars.outputs.argocd_username }}

- name: ArgoCD overvrite SSI values.yaml
uses: clowdhaus/argo-cd-action/@v1.9.0
id: argocd_image_tag_overwrite_ssi
with:
command: app set ssi-wallet
options: -p image.tag=${{ steps.tag_version.outputs.new_tag }}

- name: Configure AWS credentials IDC
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down
1 change: 0 additions & 1 deletion apps/vc-api/.env.tutorial

This file was deleted.

16 changes: 0 additions & 16 deletions apps/vc-api/.eslintrc.js

This file was deleted.

35 changes: 0 additions & 35 deletions apps/vc-api/.gitignore

This file was deleted.

128 changes: 0 additions & 128 deletions apps/vc-api/CODE_OF_CONDUCT.md

This file was deleted.

36 changes: 0 additions & 36 deletions apps/vc-api/Dockerfile

This file was deleted.

Loading

0 comments on commit a11ae07

Please sign in to comment.