-
Notifications
You must be signed in to change notification settings - Fork 408
45 lines (43 loc) · 1.22 KB
/
build-and-push-release-aws.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build and Push to AWS - Release
on:
pull_request:
branches:
- main
push:
tags:
- '**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.LLM_STUDIO_AWS_ROLE }}
role-session-name: ${{ secrets.LLM_STUDIO_AWS_ROLE_SESSION_NAME }}
aws-region: ${{ secrets.LLM_STUDIO_AWS_REGION }}
- name: Login to ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Clean Docker images
run: |-
echo "Available storage before cleaning:"
df -h
docker system prune --all --force
echo "Available storage:"
df -h
echo "Removing dotnet"
sudo rm -rf /usr/share/dotnet
echo "Available storage:"
df -h
- name: Docker Build Image
run: |-
docker build -t ${{ secrets.LLM_STUDIO_AWS_ECR }}:test .
- name: Push to AWS
run: |-
docker push ${{ secrets.LLM_STUDIO_AWS_ECR }}:test