Skip to content

Ongoing fixes

Ongoing fixes #3

Workflow file for this run

name: java invocation quickstart
on:
push:
branches: [main]
pull_request:
branches:
- main
paths:
- .github/workflows/invoke_java.yaml
- invocation/java/*
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
environment: shared-production
# Only run on main repo (not on forks)
if: github.repository_owner == 'diagridio'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
- name: build local
run: |
cd invocation/java
mvn clean install -f ./client && mvn clean install -f ./server
- name: build client container
run: |
cd invocation/java/client
docker buildx build --platform linux/amd64 -t invoke-java-client .
- name: build server container
run: |
cd invocation/java/server
docker buildx build --platform linux/amd64 -t invoke-java-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-java-client"
run: |
docker taginvoke-java-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-java-server"
run: |
docker tag invoke-java-server:latest $PUBLIC_ECR:latest
docker push $PUBLIC_ECR:latest