Skip to content

Commit

Permalink
cleanup for infra files, update github dev workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
okorolov committed Mar 8, 2024
1 parent aa7953d commit 81178d9
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 354 deletions.
61 changes: 10 additions & 51 deletions .github/workflows/dev-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- 'master'
paths-ignore:
- 'infra/**'

jobs:
build:
Expand All @@ -14,82 +12,43 @@ jobs:
strategy:
matrix:
include:
- name: rate
repository: RATE_ORACLE
- repository: RATE_ORACLE
dockerfile: rate-oracle.dockerfile
- repository: CRDAO_API
dockerfile: api.dockerfile
- repository: CRDAO_HANDLER
dockerfile: handler.dockerfile

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
${{ steps.login-ecr.outputs.registry }}/${{ secrets[format('ECR_REPOSITORY_{0}', matrix.repository)] }}
tags: |
type=sha
type=schedule
type=raw,value=latest
type=semver,pattern=v{{version}}
- name: Build and push up
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
file: infra/docker/${{ matrix.dockerfile }}
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

gitops_tasks:
name: GitOps Tasks
needs: [build]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get short sha
id: short_sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3
with:
ref: master

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

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

- name: Update Image Repo
id: imgupd
uses: mikefarah/yq@master
with:
cmd: |
yq eval '.rateOracle.image.repository = "${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY_RATE_ORACLE }}"' -i infra/helm/values-dev.yaml
yq eval '.rateOracle.image.tag = "sha-${{ steps.short_sha.outputs.short_sha }}"' -i infra/helm/values-dev.yaml
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: auto-apply image changes
7 changes: 0 additions & 7 deletions infra/ci/Dockerfile_sql-migrate

This file was deleted.

127 changes: 0 additions & 127 deletions infra/ci/Jenkinsfile_crdao

This file was deleted.

11 changes: 0 additions & 11 deletions infra/ci/push.sh

This file was deleted.

3 changes: 0 additions & 3 deletions infra/helm/.sops.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions infra/helm/Chart.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions infra/helm/secrets-dev.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions infra/helm/templates/config.yaml

This file was deleted.

77 changes: 0 additions & 77 deletions infra/helm/templates/cronjob.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions infra/helm/templates/secret.yaml

This file was deleted.

Loading

0 comments on commit 81178d9

Please sign in to comment.