dotnet fix #2
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: csharp invocation quickstart | |
on: | |
push: | |
branches: | |
- "ongoing-fixes" | |
pull_request: | |
branches: | |
- "ongoing-fixes" | |
paths: | |
- .github/workflows/invoke_csharp.yaml | |
- invocation/csharp/* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
environment: shared-production | |
# Only run on ongoing-fixes repo (not on forks) | |
if: github.repository_owner == 'diagridio' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "8.0.x" | |
- name: build local | |
run: | | |
cd invocation/csharp | |
dotnet build ./client && dotnet build ./server | |
- name: build client image | |
run: | | |
cd invocation/csharp/client | |
docker buildx build --platform linux/amd64 -t invoke-csharp-client . | |
- name: build server image | |
run: | | |
cd invocation/csharp/server | |
docker buildx build --platform linux/amd64 -t invoke-csharp-server . | |
- name: Configure AWS credentials | |
if: github.event_name != 'pull_request' | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ vars.AWS_CI_ROLE }} | |
aws-region: ${{ vars.AWS_CI_REGION }} | |
- name: Login to Amazon ECR | |
if: github.event_name != 'pull_request' | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
registry-type: public | |
- name: push client image | |
if: github.event_name != 'pull_request' | |
env: | |
PUBLIC_ECR: "${{ steps.login-ecr.outputs.registry }}/${{ vars.AWS_PUBLIC_ECR_ALIAS }}/invoke-csharp-client" | |
run: | | |
docker tag invoke-csharp-client:latest $PUBLIC_ECR:latest | |
docker push $PUBLIC_ECR:latest | |
- name: push server image | |
if: github.event_name != 'pull_request' | |
env: | |
PUBLIC_ECR: "${{ steps.login-ecr.outputs.registry }}/${{ vars.AWS_PUBLIC_ECR_ALIAS }}/invoke-csharp-server" | |
run: | | |
docker tag invoke-csharp-server:latest $PUBLIC_ECR:latest | |
docker push $PUBLIC_ECR:latest |