forked from deepjavalibrary/djl
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.99 KB
/
docker_publish.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Docker publish
on:
schedule:
- cron: '0 15 * * *'
workflow_dispatch:
inputs:
mode:
description: 'release/nightly, default is nightly'
required: true
default: 'nightly'
permissions:
id-token: write
contents: read
jobs:
publish:
if: github.repository == 'deepjavalibrary/djl'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::425969335547:role/djl-ci-publish-role
aws-region: us-east-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registries: "314815235551"
- name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set variables
run: |
DJL_VERSION=$(awk -F '=' '/djl/ {gsub(/ ?"/, "", $2); print $2}' gradle/libs.versions.toml)
echo "DJL_VERSION=$DJL_VERSION" >> $GITHUB_ENV
- name: Build djl_spark wheel
working-directory: extensions/spark/setup/
run: ./setup.py bdist_wheel
- name: Build and push nightly docker image
if: ${{ github.event.inputs.mode == '' || github.event.inputs.mode == 'nightly' }}
uses: docker/build-push-action@v4
with:
context: .
push: true
file: docker/spark/Dockerfile
tags: deepjavalibrary/djl-spark:cpu-nightly
- name: Build and push release docker image
if: ${{ github.event.inputs.mode == 'release' }}
uses: docker/build-push-action@v4
with:
context: .
file: docker/spark/Dockerfile
build-args: DJL_VERSION=${DJL_VERSION}
tags: deepjavalibrary/djl-spark:${{ env.DJL_VERSION }}-cpu