no sim for delisted market #111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Install kubectl | |
| run: | | |
| curl -o kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.23.7/2022-06-29/bin/linux/amd64/kubectl | |
| curl https://s3.us-west-2.amazonaws.com/amazon-eks/1.23.7/2022-06-29/bin/linux/amd64/kubectl.sha256 | |
| openssl sha1 -sha256 kubectl | |
| chmod +x ./kubectl | |
| kubectl version --client=true | |
| - name: Docker build | |
| uses: docker/build-push-action@v6 | |
| env: | |
| ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
| ECR_REPOSITORY: swift | |
| IMAGE_TAG: ${{ github.sha }} | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}-${{ env.BRANCH_NAME }} | |
| ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest-${{ env.BRANCH_NAME }} | |
| deploy: | |
| runs-on: ubicloud | |
| needs: [build] | |
| steps: | |
| - 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/swift-server-app | |
| kubectl rollout restart -n $BRANCH_NAME deployment/swift-confirmation-server-app | |
| kubectl rollout restart -n $BRANCH_NAME deployment/swift-ws-server-app |