-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·80 lines (71 loc) · 2.42 KB
/
build-base-image.yml
File metadata and controls
executable file
·80 lines (71 loc) · 2.42 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build and Push AWS Lambda Base Image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
push_to_registry:
name: Build and Push Docker Image
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
suffix=-${{ matrix.python-version }}
tags: |
type=ref,event=branch
type=raw,value=${{ github.ref_name }}
type=raw,value=latest,suffix=,enable=${{ github.ref_name == github.event.repository.default_branch }}
images: |
name=${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer,enable=false
name=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
- name: Build and Push Base Image
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
INVOKER_ID=${{ secrets.INVOKER_ID }}
INVOKER_KEY=${{ secrets.INVOKER_KEY }}
INVOKER_REGION=${{ secrets.INVOKER_REGION }}
# name: Build and Push to DockerHub Registry
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Log in to Docker Hub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and Push Base Image
# uses: docker/build-push-action@v2
# with:
# push: true
# tags: ${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer
# build-args: |
# INVOKER_ID=${{ secrets.INVOKER_ID }}
# INVOKER_KEY=${{ secrets.INVOKER_KEY }}
# INVOKER_REGION=${{ secrets.INVOKER_REGION }}