-
Notifications
You must be signed in to change notification settings - Fork 10
75 lines (65 loc) · 2.33 KB
/
base.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
name: 'base'
on:
push:
paths:
- 'run.sh'
- '.github/workflows/base.yml'
- 'build_*.dockerfile'
- 'run_*.dockerfile'
- 'ls_base.dockerfile'
workflow_dispatch:
schedule:
- cron: '0 0 1,16 * *'
jobs:
base:
strategy:
fail-fast: false
matrix:
include: [
{ distro: arch, version: '' },
{ distro: debian, version: buster },
{ distro: debian, version: bullseye },
{ distro: debian, version: bookworm },
{ distro: fedora, version: 37 },
{ distro: fedora, version: 38 },
{ distro: ubuntu, version: 20 },
{ distro: ubuntu, version: 22 },
{ distro: ls, version: '' },
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./run.sh -c $DISTRIBUTION $VERSION
env:
DISTRIBUTION: ${{ matrix.distro }}
VERSION: ${{ matrix.version }}
- name: 'Build ghdl/debug:base'
# We need to use 'buster' because 'gnat-gps' is not available on 'bullseye' or 'bookworm'
if: (matrix.distro == 'debian') && (matrix.version == 'buster')
run: |
docker build -t ghdl/debug:base - <<-EOF
FROM ghdl/build:buster-mcode
RUN apt update -qq && apt install -y python3-pip gnat-gps graphviz gdb \
&& ln -s /usr/bin/pip3 /usr/bin/pip
EOF
- name: 'Build ghdl/build:doc'
if: (matrix.distro == 'debian') && (matrix.version == 'bookworm')
run: |
docker build -t ghdl/build:doc . -f- <<-'EOF'
FROM ghdl/build:bookworm-mcode
RUN apt update -qq && apt install -y python3-pip python3-venv graphviz
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
EOF
- name: Deploy to DockerHub
if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker'
uses: pyTooling/Actions/with-post-step@r0
with:
main: |
# Release
echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin
./run.sh base
post: docker logout docker.io
# FIXIT: ensure that branches different from 'master' do not trigger deploy steps!
# FIXIT: ensure that PR's cannot access/use secrets!