forked from runpod/containers
-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (78 loc) · 2.66 KB
/
Copy pathbase.yml
File metadata and controls
87 lines (78 loc) · 2.66 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
81
82
83
84
85
86
87
name: Docker Image Build and Release
on:
push:
paths:
- ".github/workflows/base.yml"
- "official-templates/base/docker-bake.hcl"
- "official-templates/base/Dockerfile"
- "official-templates/pytorch/docker-bake.hcl"
- "official-templates/pytorch/Dockerfile"
- "official-templates/shared/**"
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-base:
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Docker
uses: ./.github/actions/docker-setup
id: setup
with:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build base images
uses: docker/bake-action@v6
env:
BUILDX_BAKE_ENTITLEMENTS_FS: 0
with:
source: .
files: |
official-templates/shared/versions.hcl
official-templates/base/docker-bake.hcl
push: true
set: |
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}
build-pytorch:
needs: build-base
# always() forces job run even if the dependant is skipped (but not if it failed)
if: always() && (needs.build-base.result == 'success' || needs.build-base.result == 'skipped')
runs-on: blacksmith-8vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if build is needed
uses: tj-actions/changed-files@v46
id: changes
with:
files_yaml: |
pytorch:
- 'official-templates/shared/**'
- 'official-templates/pytorch/**'
- name: Setup Docker
if: steps.changes.outputs.pytorch_any_changed == 'true'
uses: ./.github/actions/docker-setup
id: setup
with:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build pytorch images
if: steps.changes.outputs.pytorch_any_changed == 'true'
uses: docker/bake-action@v6
env:
BUILDX_BAKE_ENTITLEMENTS_FS: 0
with:
source: .
files: |
official-templates/shared/versions.hcl
official-templates/pytorch/docker-bake.hcl
push: true
set: |
${{ steps.setup.outputs.is-production != 'true' && format('*.args.RELEASE_VERSION={0}', steps.setup.outputs.release-suffix) || '' }}