-
Notifications
You must be signed in to change notification settings - Fork 5
102 lines (99 loc) · 2.7 KB
/
octave.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
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
name: Build Octave container images
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Rebuild container images on every 1st of a month at 02:03
schedule:
- cron: "3 2 1 * *"
env:
OCTAVE_LATEST: 8.4.0
jobs:
octave:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
version:
- 4.0.0
- 4.0.1
- 4.0.2
- 4.0.3
- 4.2.0
- 4.2.1
- 4.2.2
- 4.4.0
- 4.4.1
- 5.1.0
- 5.2.0
- 6.1.0
- 6.2.0
- 6.3.0
- 6.4.0
- 7.1.0
- 7.2.0
- 7.3.0
- 8.1.0
- 8.2.0
- 8.3.0
- 8.4.0
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Determine build image version
run: |
VER=${{ matrix.version }}
BUILD_VER=${VER%%.*}
## Exception, because of too old libraries.
if [ "${VER:0:3}" = "4.4" ]; then
BUILD_VER=5
fi
if [ "${VER:0:1}" = "7" ]; then
BUILD_VER=6
fi
GNU_MIRROR=https://ftpmirror.gnu.org/octave
echo "OCTAVE_VERSION_MAJOR=${BUILD_VER}" >> $GITHUB_ENV
echo "GNU_MIRROR=${GNU_MIRROR}" >> $GITHUB_ENV
-
name: Set "latest" tag
if: ${{ matrix.version == env.OCTAVE_LATEST }}
run: |
echo "DOCKER_LATEST_TAG=gnuoctave/octave:latest" >> $GITHUB_ENV
echo "GHCR_LATEST_TAG=ghcr.io/gnu-octave/octave:latest" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: octave.docker
build-args: |
OCTAVE_VERSION=${{ matrix.version }}
OCTAVE_VERSION_MAJOR=${{ env.OCTAVE_VERSION_MAJOR }}
GNU_MIRROR=${{ env.GNU_MIRROR }}
push: true
tags: |
gnuoctave/octave:${{ matrix.version }}
ghcr.io/gnu-octave/octave:${{ matrix.version }}
${{ env.DOCKER_LATEST_TAG }}
${{ env.GHCR_LATEST_TAG }}