Gateway: 0.1.261 #525
Workflow file for this run
This file contains 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 and release Gateway | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
inputs: | |
app_version: | |
description: Semantic version of release | |
required: true | |
type: string | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build_and_release_gateway: | |
if: startsWith(github.ref, 'refs/tags/gateway-') || inputs.app_version != '' | |
environment: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Set up Helm | |
uses: azure/[email protected] | |
with: | |
version: v3.14.3 | |
- name: Set version | |
id: set-version | |
run: | | |
if [[ ! -z "${{ inputs.app_version }}" ]]; then | |
echo "app_version=${{ inputs.app_version }}" >> $GITHUB_OUTPUT | |
else | |
echo "app_version=${GITHUB_REF_NAME#gateway-}" >> $GITHUB_OUTPUT | |
fi | |
- 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 | |
with: | |
registry-type: public | |
mask-password: 'true' | |
- name: Build and push gateway container image to Amazon ECR | |
uses: docker/build-push-action@v5 | |
with: | |
file: ./docker/Dockerfile.gateway | |
push: true | |
tags: | | |
${{ steps.login-ecr.outputs.registry }}/n4e0e1y0/beta9-gateway:${{ steps.set-version.outputs.app_version }} | |
${{ steps.login-ecr.outputs.registry }}/n4e0e1y0/beta9-gateway:latest | |
target: release | |
platforms: linux/amd64 | |
- name: Build and push proxy container image to Amazon ECR | |
uses: docker/build-push-action@v5 | |
with: | |
file: ./docker/Dockerfile.proxy | |
push: true | |
tags: | | |
${{ steps.login-ecr.outputs.registry }}/n4e0e1y0/beta9-proxy:${{ steps.set-version.outputs.app_version }} | |
${{ steps.login-ecr.outputs.registry }}/n4e0e1y0/beta9-proxy:latest | |
target: release | |
platforms: linux/amd64 | |
- 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 ${{ steps.set-version.outputs.app_version }} --app-version ${{ steps.set-version.outputs.app_version }} | |
helm push $REPOSITORY-${{ steps.set-version.outputs.app_version }}.tgz oci://$REGISTRY/$REGISTRY_ALIAS |