-
Notifications
You must be signed in to change notification settings - Fork 12
113 lines (103 loc) · 3.26 KB
/
sub_test.yaml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# ------------------------------------------------------------------------
# Copyright (c) 2020-2023 Riccardo De Martis. MIT License.
# All Trademarks referred to are the property of their respective owners.
# ------------------------------------------------------------------------
name: sub.release
on:
workflow_call:
inputs:
DOCKERHUB_REPO:
required: true
type: string
DOCKERHUB_TAG:
required: true
type: string
DOCKER_CONTEXT:
required: true
type: string
MATLAB_NAME:
required: true
type: string
is_latest:
required: false
default: false
type: boolean
is_latest_meshlab:
required: false
default: false
type: boolean
# secrets:
# DOCKERHUB_USERNAME:
# required: true
# DOCKERHUB_TOKEN:
# required: true
env:
TEST_TAG: test
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: false # kept as removing them is time-consuming
docker-images: true
swap-storage: true
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# -
# name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# -
# name: Create cache folders
# run: mkdir /tmp/.buildx-cache /tmp/.buildx-cache-new
#
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ inputs.DOCKERHUB_REPO }}
-
name: Build and push [test] :${{ env.TEST_TAG }}
uses: docker/build-push-action@v5
with:
context: ./${{ inputs.DOCKER_CONTEXT }}
load: true
platforms: linux/amd64
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
tags: ${{ inputs.DOCKERHUB_REPO }}:${{ env.TEST_TAG }}
# - # Temp fix
# # https://github.com/docker/build-push-action/issues/252
# # https://github.com/moby/buildkit/issues/1896
# name: Move cache (Temp fix)
# run: |
# rm -rf /tmp/.buildx-cache
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache
# -
# name: Image simple check [test]
# run: |
# docker run --rm ${{ inputs.DOCKERHUB_REPO }}:${{ env.TEST_TAG }}
-
name: MCR release check [test]
run: |
docker run -v "${{ github.workspace }}/test:/test" --rm ${{ inputs.DOCKERHUB_REPO }}:${{ env.TEST_TAG }} bash -c "/test/mcr_version.sh ${{ inputs.MATLAB_NAME }}"