Skip to content

Commit

Permalink
ci(): build linux amd64 image to ecr
Browse files Browse the repository at this point in the history
  • Loading branch information
ivyxjc committed Sep 14, 2023
1 parent d21debd commit b7e9dfd
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/ci-ecr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build all-in-one

on:
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag'
default: 'v1.49.0-flexcompute'
type: string
required: false
imageTag:
description: 'imageTag'
required: true
type: string
default: 'v1.49.0-flexcompute'

concurrency:
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
cancel-in-progress: true

# See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
permissions:
contents: read

jobs:
all-in-one:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
submodules: true

- name: Fetch git tags
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.21.x

- name: Setup Node.js version
uses: ./.github/actions/setup-node.js

- name: Export BRANCH variable
uses: ./.github/actions/setup-branch

- name: Install tools
run: make install-ci

- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1


- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: public.ecr.aws/a8c8b9j3/jaegertracing/all-in-one
tags: |
${{ inputs.imageTag }}
- run: make create-base-image

- name: Docker build and push
id: docker_build
uses: docker/build-push-action@v2
with:
file: Dockerfile
build-args: |
base_image=localhost:5000/baseimg_alpine:latest
debug_image=localhost:5000/debugimg_alpine:latest
TARGETARCH=amd64
push: true
context: cmd/all-in-one
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit b7e9dfd

Please sign in to comment.