Skip to content

Commit

Permalink
ci: improved workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
demartis committed May 10, 2023
1 parent ce40434 commit 4a97b29
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
# This is the master workflow, taken by CI of GitHub.
# It (only) aims at properly organizing the sub-workflows.

name: ci
name: CI

on:
push:
branches:
- "master"

env:
REPO: demartis/matlab-runtime
LATEST_TAG: latest
concurrency:
group: CI-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
DOCKERHUB_REPO: demartis/matlab-runtime

jobs:

Expand All @@ -30,3 +32,6 @@ jobs:
R2020a:
needs: [ Prepare ]
uses: ./.github/workflows/sub_R2020a.yaml
with:
DOCKERHUB_TAG: latest
DOCKER_CONTEXT: latest
5 changes: 4 additions & 1 deletion .github/workflows/sub_description.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Description

on:
workflow_call:

jobs:

build:
Expand All @@ -12,4 +15,4 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.REPO }}
repository: ${{ env.DOCKERHUB_REPO }}
8 changes: 8 additions & 0 deletions .github/workflows/sub_prepare.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Prepare

on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

jobs:

build:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
name: R2020a
name: Release

env:
LATEST_TAG: latest
on:
workflow_call:
inputs:
DOCKERHUB_TAG:
required: true
type: string
DOCKER_CONTEXT:
required: true
type: string


jobs:


build:
runs-on: ubuntu-latest
continue-on-error: false
continue-on-error: true
steps:
-
name: Build and export to Docker
uses: docker/build-push-action@v4
with:
context: ./latest
tags: ${{ env.REPO }}:${{ env.LATEST_TAG }}
context: ./${{ inputs.DOCKER_CONTEXT }}
tags: ${{ env.DOCKERHUB_REPO }}:${{ inputs.DOCKERHUB_TAG }}
# outputs: type=docker,dest=/tmp/myimage.tar
-
name: Inspect
run: |
docker image inspect ${{ env.REPO }}:${{ env.LATEST_TAG }}
docker image inspect ${{ env.DOCKERHUB_REPO }}:${{ inputs.DOCKERHUB_TAG }}
-
name: Test
run: |
docker run --rm ${{ env.REPO }}:${{ env.LATEST_TAG }} echo "TODO: ADD MCR TEST"
-
name: Update repo description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.REPO }}
docker run --rm ${{ env.DOCKERHUB_REPO }}:${{ inputs.DOCKERHUB_TAG }} echo "TODO: ADD MCR TEST"
# -
# name: Upload artifact
Expand Down

0 comments on commit 4a97b29

Please sign in to comment.