Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mainnet with new pipeline #6

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/mainnet-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Image And Deploy

on:
push:
branches: [mainnet-beta]

jobs:
build:
runs-on: ubicloud
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_PROD }}
aws-region: ${{ secrets.EKS_PROD_REGION }}

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

- name: Docker build
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: solana-actions-server
IMAGE_TAG: ${{ github.sha }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
docker build \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY/$ECR_REPOSITORY:latest-$BRANCH_NAME \
-f ./Dockerfile \
.

docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest-$BRANCH_NAME

deploy:
runs-on: ubicloud
needs: [build]
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_PROD }}
aws-region: ${{ secrets.EKS_PROD_REGION }}

- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: 'v1.30.0'

- name: Configure AWS EKS Credentials
run: aws eks update-kubeconfig --name ${{ secrets.EKS_PROD_CLUSTER_NAME }} --region ${{ secrets.EKS_PROD_REGION }} --role-arn ${{ secrets.EKS_PROD_DEPLOY_ROLE }}

- name: Restart deployment
env:
BRANCH_NAME: ${{ github.ref_name }}
run: |
kubectl rollout restart -n $BRANCH_NAME deployment/solana-actions-server-app
67 changes: 67 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Image And Deploy

on:
push:
branches: [master]

jobs:
build:
runs-on: ubicloud
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_NON_PROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_NON_PROD }}
aws-region: ${{ secrets.EKS_NON_PROD_REGION }}

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

- name: Docker build
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: solana-actions-server
IMAGE_TAG: ${{ github.sha }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
docker build \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY/$ECR_REPOSITORY:latest-$BRANCH_NAME \
-f ./Dockerfile \
.

docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest-$BRANCH_NAME

deploy:
runs-on: ubicloud
needs: [build]
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_NON_PROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_NON_PROD }}
aws-region: ${{ secrets.EKS_NON_PROD_REGION }}

- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: 'v1.30.0'

- name: Configure AWS EKS Credentials
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 }}

- name: Restart deployment
env:
BRANCH_NAME: ${{ github.ref_name }}
run: |
kubectl rollout restart -n $BRANCH_NAME deployment/solana-actions-server-app