Handle signing key and event key #7
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_GH_ACTION_ACCESS }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Login to AWS ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Image metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ steps.login-ecr.outputs.registry }}/rust-sdk | |
tags: | | |
type=sha,prefix= | |
- name: Build and Push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
provenance: false | |
file: inngest/examples/axum/Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
platform: linux/amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_GH_ACTION_ACCESS }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Login to AWS ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Image metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ steps.login-ecr.outputs.registry }}/rust-sdk | |
tags: | | |
type=sha,prefix= | |
- name: Replace placeholders in kustomize | |
run: | | |
# image name | |
sed -i "s/IMAGE_NAME/${{ steps.login-ecr.outputs.registry }}/g" kustomization.yaml | |
# image tag | |
sed -i "s/IMAGE_TAG/${{ env.DOCKER_METADATA_OUTPUT_VERSION }}/g" kustomization.yaml | |
# siging key | |
sed -i "s/REPLACE_SIGNING_KEY/${{ secrets.INNGEST_SIGNING_KEY }}/g" kustomization.yaml | |
# event key | |
sed -i "s/REPLACE_EVENT_KEY/${{ secrets.INNGEST_EVENT_KEY }}/g" kustomization.yaml | |
- name: Deploy | |
uses: ianbelcher/eks-kubectl-action@master # ALERT: master...? | |
with: | |
cluster_name: ${{ secrets.EKS_CLUSTER_NAME }} | |
kubernetes_version: v1.28.4 | |
eks_role_arn: ${{ secrets.EKS_ACCESS_ARN }} | |
args: apply -k ./opt/deploy/overlays/staging |