Skip to content

Instantly share code, notes, and snippets.

View wenqiglantz's full-sized avatar

Wenqi Glantz wenqiglantz

View GitHub Profile
@wenqiglantz
wenqiglantz / ci.yml
Last active February 14, 2023 02:22
name: CI workflow for building graviton image and publishing it to ECR
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the workflow against'
type: environment
required: true
pull_request:
name: CI Graviton workflow for Spring Boot microservices
on:
workflow_call:
inputs:
# pass in environment through manual trigger, if not passed in, default to 'dev'
env:
required: true
type: string
default: 'dev'
name: "Terraform Deployment"
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the workflow against'
type: environment
required: true
push:
name: "Terraform Deployment"
on:
workflow_call:
inputs:
# working-directory is added to specify "terraform" directory in project source code as that's where the terraform files live.
working-directory:
required: false
type: string
default: './terraform'
@RestController
@RequestMapping(value = "/customers", produces = MediaType.APPLICATION_JSON_VALUE)
@ImportRuntimeHints(CustomerController.CustomerControllerRuntimeHints.class)
public class CustomerController {
private final CustomerService customerService;
public CustomerController(CustomerService customerService) {
this.customerService = customerService;
}
name: CI JVM workflow
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the workflow against'
type: environment
required: true
pull_request:
name: CI Native Image Buildpacks workflow
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the workflow against'
type: environment
required: true
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowImagePushAndPull",
"Effect": "Allow",
"Action": [
"ecr:BatchCheckLayerAvailability",
"ecr:CompleteLayerUpload",
"ecr:InitiateLayerUpload",
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::#########:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
jobs:
build:
permissions:
id-token: write # need this for OIDC
contents: read
uses: <path to reusable workflows repo>/.github/workflows/java-maven-build-test.yml@latest
with:
# for multi-repo, set it as "." (current directory); for monorepo, specify the file path for UI, such as "./frontend"
working-directory: .