Skip to content

build-containers

build-containers #26

name: build-containers
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: false
permissions:
contents: read
id-token: write # required for OIDC
jobs:
build-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: ["actions-runner-iac","aws-cli-v2", "k8s-toolkit-diag", "k8s-toolkit-set-1", "k8s-toolkit-set-2", "k8s-toolkit-set-3", "terraform-tfcmt","terraform-cicd"]
steps:
- uses: actions/checkout@v3
- name: "aws:configure-credentials"
uses: aws-actions/configure-aws-credentials@v1
id: aws-credentials
with:
role-to-assume: "arn:aws:iam::${{ secrets.RAFTECH_AWS_ACCOUNT_ID }}:role/GithubActionsRole"
role-session-name: "raftech-public-ecr-gha"
aws-region: "us-east-1"
mask-aws-account-id: no
- name: "aws:login-to-ecr"
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: "public"
- name: "docker:setup-buildx"
uses: docker/setup-buildx-action@v3
- name: "docker:setup-metadata"
id: metadata
uses: docker/[email protected]
with:
images: ${{ steps.login-ecr.outputs.registry }}/p8o7f1g4/platform/${{ matrix.image }}
tags: |
# type=ref,event=branch
# type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
-
name: docker::build-and-push
id: push
uses: docker/[email protected]
with:
context: "./platform/${{ matrix.image }}"
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}