Skip to content

Commit db9c93f

Browse files
committed
chore: add gh pipelines
1 parent 0c13655 commit db9c93f

File tree

6 files changed

+130
-223
lines changed

6 files changed

+130
-223
lines changed

Diff for: .github/actions/setup-solana/action.yaml

-21
This file was deleted.

Diff for: .github/actions/setup/action.yaml

-7
This file was deleted.

Diff for: .github/workflows/build.yaml

-123
This file was deleted.

Diff for: .github/workflows/mainnet-beta.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Distributor Build Image And Deploy
2+
3+
on:
4+
push:
5+
branches: [mainnet-beta]
6+
7+
jobs:
8+
build:
9+
runs-on: ubicloud
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v3
13+
with:
14+
submodules: 'recursive'
15+
16+
- name: Configure AWS credentials
17+
uses: aws-actions/configure-aws-credentials@master
18+
with:
19+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PROD }}
20+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_PROD }}
21+
aws-region: ${{ secrets.EKS_PROD_REGION }}
22+
23+
- name: Log in to Amazon ECR
24+
id: login-ecr
25+
uses: aws-actions/amazon-ecr-login@v2
26+
27+
- name: Build and push
28+
uses: docker/build-push-action@v6
29+
env:
30+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
31+
ECR_REPOSITORY: distributor-api
32+
IMAGE_TAG: ${{ github.sha }}
33+
BRANCH_NAME: ${{ github.ref_name }}
34+
with:
35+
context: .
36+
push: true
37+
tags: |
38+
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}-${{ env.BRANCH_NAME }}-amd64
39+
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest-${{ env.BRANCH_NAME }}-amd64
40+
41+
deploy:
42+
runs-on: ubicloud
43+
needs: [build]
44+
steps:
45+
- name: Configure AWS credentials
46+
uses: aws-actions/configure-aws-credentials@master
47+
with:
48+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PROD }}
49+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_PROD }}
50+
aws-region: ${{ secrets.EKS_PROD_REGION }}
51+
52+
- name: Install kubectl
53+
uses: azure/setup-kubectl@v3
54+
with:
55+
version: 'v1.30.0'
56+
57+
- name: Configure AWS EKS Credentials
58+
run: aws eks update-kubeconfig --name ${{ secrets.EKS_PROD_CLUSTER_NAME }} --region ${{ secrets.EKS_PROD_REGION }} --role-arn ${{ secrets.EKS_PROD_DEPLOY_ROLE }}
59+
60+
- name: Restart deployment
61+
env:
62+
BRANCH_NAME: ${{ github.ref_name }}
63+
run: |
64+
kubectl rollout restart -n $BRANCH_NAME statefulset/airdrop-distributor
65+
kubectl rollout restart -n $BRANCH_NAME statefulset/airdrop-distributor-2
66+
kubectl rollout restart -n $BRANCH_NAME statefulset/airdrop-distributor-3

Diff for: .github/workflows/master.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Distributor Build Image And Deploy
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
build:
9+
runs-on: ubicloud
10+
steps:
11+
- name: Checkout Code
12+
uses: actions/checkout@v3
13+
with:
14+
submodules: recursive
15+
16+
- name: Configure AWS credentials
17+
uses: aws-actions/configure-aws-credentials@master
18+
with:
19+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_NON_PROD }}
20+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_NON_PROD }}
21+
aws-region: ${{ secrets.EKS_NON_PROD_REGION }}
22+
23+
- name: Log in to Amazon ECR
24+
id: login-ecr
25+
uses: aws-actions/amazon-ecr-login@v2
26+
27+
- name: Build and push
28+
uses: docker/build-push-action@v6
29+
env:
30+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
31+
ECR_REPOSITORY: distributor-api
32+
IMAGE_TAG: ${{ github.sha }}
33+
BRANCH_NAME: ${{ github.ref_name }}
34+
with:
35+
context: .
36+
push: true
37+
tags: |
38+
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}-${{ env.BRANCH_NAME }}-amd64
39+
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest-${{ env.BRANCH_NAME }}-amd64
40+
41+
deploy:
42+
runs-on: ubicloud
43+
needs: [build]
44+
steps:
45+
- name: Configure AWS credentials
46+
uses: aws-actions/configure-aws-credentials@master
47+
with:
48+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_NON_PROD }}
49+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_NON_PROD }}
50+
aws-region: ${{ secrets.EKS_NON_PROD_REGION }}
51+
52+
- name: Install kubectl
53+
uses: azure/setup-kubectl@v3
54+
with:
55+
version: 'v1.30.0'
56+
57+
- name: Configure AWS EKS Credentials
58+
run: aws eks update-kubeconfig --name ${{ secrets.EKS_NON_PROD_CLUSTER_NAME }} --region ${{ secrets.EKS_NON_PROD_REGION }} --role-arn ${{ secrets.EKS_NON_PROD_DEPLOY_ROLE }}
59+
60+
- name: Restart deployment
61+
env:
62+
BRANCH_NAME: ${{ github.ref_name }}
63+
run: |
64+
kubectl rollout restart -n $BRANCH_NAME statefulset/master-airdrop-distributor

Diff for: .github/workflows/release.yaml

-72
This file was deleted.

0 commit comments

Comments
 (0)