Skip to content

change to holesky.

change to holesky. #10

name: Deploy to Amazon EKS staging
on:
push:
branches:
- dvt
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: azure/[email protected]
with:
version: 'v1.21.12'
id: kubectl-install
- name: Use kubectl
env:
KUBECTL_BIN: ${{ steps.kubectl-install.outputs.kubectl-path }}
run: |
mv $KUBECTL_BIN /usr/local/bin/kubectl
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: safestake-discord-faucet2
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
pwd
ls -la
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
- name: Generate kubeconfig
run: |
aws eks --region ap-southeast-1 update-kubeconfig --name ss-testnet
- uses: azure/setup-helm@v3
id: helm-install
- name: Helm upgrade chart
env:
IMAGE_TAG: ${{ github.sha }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN2 }}
ERC20_ADDRESS: ${{ secrets.ERC20_ADDRESS2 }}
FAUCET_PRIVATE_KEY: ${{ secrets.FAUCET_PRIVATE_KEY }}
FAUCET_PUBLIC_KEY: ${{ secrets.FAUCET_PUBLIC_KEY }}
HELM_BIN: ${{ steps.helm-install.outputs.helm-path }}
DATABASE_URI: ${{ secrets.DATABASE_URI }}
run: |
echo "Helm upgrade safestake-discord-faucet2 $IMAGE_TAG"
$HELM_BIN upgrade --install -f $GITHUB_WORKSPACE/cicd/safestake-faucet/values2.yaml ss-faucet2 $GITHUB_WORKSPACE/cicd/safestake-faucet --set=image.tag=$IMAGE_TAG --namespace=staging --set=env.discord_bot_token=$DISCORD_TOKEN --set=env.erc20_address=$ERC20_ADDRESS --set=env.faucet_private_key=$FAUCET_PRIVATE_KEY --set=env.faucet_public_key=$FAUCET_PUBLIC_KEY --set env.database_uri=$DATABASE_URI