diff --git a/.github/workflows/deploy-gateway.yml b/.github/workflows/deploy-gateway.yml deleted file mode 100644 index 15f50431a..000000000 --- a/.github/workflows/deploy-gateway.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Deploy Gateway - -on: - workflow_dispatch: - inputs: - environment: - description: The environment to deploy the release to. - required: true - type: choice - default: staging - options: - - staging - - production - region: - description: The region to deploy the release to. - required: true - type: choice - default: us-east-1 - options: - - us-east-1 - version: - description: The version of the release to deploy. - required: true - type: string - -permissions: - id-token: write - -jobs: - deploy: - environment: ${{ inputs.environment }} - runs-on: ubuntu-latest - steps: - - name: Add kubectl - uses: azure/setup-kubectl@v3 - with: - version: v1.29.2 - - - name: Get AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ inputs.region }} - role-to-assume: ${{ secrets.AWS_IAM_ROLE_US_EAST_1 }} - - - name: Get AWS Caller Identity - run: | - aws sts get-caller-identity - - - name: Get kubeconfig - run: | - aws eks update-kubeconfig --region ${{ inputs.region }} --name ${{ vars.EKS_CLUSTER_NAME }} - - - name: Get all pods - run: | - kubectl get pods -A diff --git a/.github/workflows/release-chart.yml b/.github/workflows/release-chart.yml deleted file mode 100644 index b79998647..000000000 --- a/.github/workflows/release-chart.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Build and push Chart - -on: - release: - types: [created] - - workflow_dispatch: - inputs: - chart_version: - description: Version of the Helm Chart - required: true - type: string - -jobs: - build_and_push_chart: - environment: Release - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup helm - uses: azure/setup-helm@v3 - with: - version: v3.14.0 - - - name: Log in to Amazon ECR - uses: aws-actions/amazon-ecr-login@v2 - id: login-ecr - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} - with: - mask-password: 'true' - registry-type: public - - - name: Package and push helm chart to Amazon ECR - env: - REGISTRY: ${{ steps.login-ecr.outputs.registry }} - REGISTRY_ALIAS: n4e0e1y0 - REPOSITORY: beta9-chart - run: | - cd ./deploy/charts - helm package beta9 --dependency-update --version ${{ inputs.chart_version }} - helm push $REPOSITORY-${{ inputs.chart_version }}.tgz oci://$REGISTRY diff --git a/.github/workflows/release-gateway.yml b/.github/workflows/release-gateway.yml index d0617df56..6b019facf 100644 --- a/.github/workflows/release-gateway.yml +++ b/.github/workflows/release-gateway.yml @@ -12,35 +12,46 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 + + - name: Set up Helm + uses: azure/setup-helm@v4.1.0 + with: + version: v3.14.3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_IAM_ROLE_GITHUB }} + aws-region: us-east-1 - name: Log in to Amazon ECR uses: aws-actions/amazon-ecr-login@v2 id: login-ecr - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} with: - mask-password: 'true' registry-type: public + mask-password: 'true' - - name: Extract tag name - run: echo "TAG_NAME=${GITHUB_REF#refs/tags/gateway-}" >> $GITHUB_ENV - - - name: Build and push Docker image - uses: docker/build-push-action@v4 + - name: Build and push container image to Amazon ECR + uses: docker/build-push-action@v5 with: - context: . file: ./docker/Dockerfile.gateway push: true - tags: ${{ secrets.ECR_REGISTRY }}/beta9-gateway:${{ env.TAG_NAME }} - build-args: --target=release - load: false - registry: ${{ steps.login-ecr.outputs.registry }} - repository: ${{ steps.login-ecr.outputs.registry }}/beta9-gateway - add_git_labels: true - tag_with_ref: true + tags: | + ${{ steps.login-ecr.outputs.registry }}/beta9-gateway:${{ github.ref_name }} + ${{ steps.login-ecr.outputs.registry }}/beta9-gateway:latest + target: release + platforms: linux/amd64,linux/arm64 + + - name: Package and push Helm chart to Amazon ECR + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REGISTRY_ALIAS: n4e0e1y0 + REPOSITORY: beta9-chart + run: | + cd deploy/charts + helm package ./beta9 --dependency-update --version ${{ github.ref_name }} --app-version ${{ github.ref_name }} + helm push $REPOSITORY-${{ github.ref_name }}.tgz oci://$REGISTRY