Skip to content

Migrating to ECR and docker distroless images #1

Migrating to ECR and docker distroless images

Migrating to ECR and docker distroless images #1

name: "Build attester image"
on:
workflow_call:
inputs:
push:
required: true
type: boolean
target:
required: true
type: string
tag:
required: true
type: string
permissions:
# Needed to configure aws credentials step
id-token: write
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 30
steps:

Check failure on line 27 in .github/workflows/build-attester.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-attester.yaml

Invalid workflow file

You have an error in your yaml syntax on line 27
- name: Shorten SHA TAG
id: env-vars
shell: bash
env:
FULL_SHA: ${{ inputs.tag }}
run: echo "TAG=${FULL_SHA::16}" >> $GITHUB_OUTPUT
- name: Repository checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::291847425310:role/gitHubDeploymentsRoleFastAuth
role-session-name: deploymentsRoleFastAuth
role-duration-seconds: 900
aws-region: us-east-1
- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Restore local cache
- name: Restore cache
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ github.job }}-${{ runner.os }}-buildx-attester
restore-keys: |
${{ github.job }}-${{ runner.os }}-buildx-attester
# Build docker image
- name: Build docker image
uses: docker/build-push-action@v5
env:
TAG: ${{ steps.env-vars.outputs.TAG }}
with:
context: .
file: docker/attester.Dockerfile
provenance: false
target: ${{ inputs.target }}
push: ${{ inputs.push }}
tags: |
291847425310.dkr.ecr.us-east-1.amazonaws.com/fast-auth/attester:${{ env.TAG }}
291847425310.dkr.ecr.us-east-1.amazonaws.com/fast-auth/attester:latest
outputs: type=image
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
build-args: |
BASE_IMAGE=291847425310.dkr.ecr.us-east-1.amazonaws.com/fast-auth/base:${{ env.TAG }}
TURBO_TEAM=peersyst
secrets: |
turbo_token=${{ secrets.TURBO_TOKEN }}
# Save latest cache
- name: Save cache
if: always()
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache