Skip to content

Commit

Permalink
[lepton] add workflow yamls
Browse files Browse the repository at this point in the history
  • Loading branch information
FillZpp committed Nov 19, 2024
1 parent 645f6ad commit 6858f0f
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/krew-release.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/lepton-build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Docker Image

on:
workflow_call:
inputs:
repo:
required: true
type: string
tag:
required: false
type: string
default: test$(git rev-parse --short HEAD)
commit:
required: false
type: string
default: $(git rev-parse --short HEAD)
runs-on:
required: false
type: string
default: ubuntu-latest

jobs:
build:
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install awscli
run: |
python -m pip install --upgrade pip
pip install awscli
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build and push the Docker image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
set -x
docker build . --file Dockerfile \
--tag ${{ inputs.repo }}:${{ inputs.tag }} \
--build-arg GIT_COMMIT=${{ inputs.commit }} \
--build-arg REPO=$ECR_REGISTRY/ecr-public
echo "tagging container image with ${{ inputs.repo }}:${{ inputs.tag }}}"
docker tag ${{ inputs.repo }}:${{ inputs.tag }} $ECR_REGISTRY/${{ inputs.repo }}:${{ inputs.tag }}
docker push $ECR_REGISTRY/${{ inputs.repo }}:${{ inputs.tag }}
15 changes: 15 additions & 0 deletions .github/workflows/lepton-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: lepton-release

on:
push:
tags:
- "*"

jobs:
build-release:
uses: ./.github/workflows/lepton-build-image.yaml
secrets: inherit
with:
repo: lepton-kueue
tag: ${GITHUB_REF##*/}
commit: ${GITHUB_REF##*/}

0 comments on commit 6858f0f

Please sign in to comment.