Skip to content

Commit 8af40b7

Browse files
committed
Use GitHub action to build and publish the images
once merged/clone you have to define the following GitHub secrets variables: (adjust values if needed) DOCKER_REPO DOCKER_USERNAME DOCKER_GITHUB_TOKEN
1 parent 23baf5f commit 8af40b7

File tree

4 files changed

+48
-13
lines changed

4 files changed

+48
-13
lines changed
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# https://github.com/marketplace/actions/publish-docker
2+
3+
name: Publish to Docker
4+
on: [push]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
perl-version:
13+
- '5.30'
14+
- '5.28'
15+
- '5.26'
16+
- '5.24'
17+
- '5.22'
18+
- '5.20'
19+
- '5.18'
20+
- '5.16'
21+
- '5.14'
22+
- '5.12'
23+
- '5.10'
24+
- '5.8'
25+
26+
steps:
27+
- uses: actions/checkout@master
28+
- name: Publish to Registry
29+
uses: elgohr/Publish-Docker-Github-Action@master
30+
with:
31+
name: ${{ secrets.DOCKER_REPO }}
32+
username: ${{ secrets.DOCKER_USERNAME }}
33+
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
34+
dockerfile: Dockerfile
35+
buildargs: BASE=${{ matrix.perl-version }}
36+
tags: "v${{ matrix.perl-version }}"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ pre-installed bits:
1010
* various testing modules (see `cpanfile` in this repo)
1111

1212

13-
To build and push:
14-
```bash
15-
./bin/build-and-push.sh
13+
## Building Docker images
14+
15+
When pushing to GitHub, it's using a GitHub action `.github/workflows/publish-to-docker.yml`
16+
to automagically build and publish the docker images for you.
17+
18+
You would have to set in your GitHub repository the following secret variables, with some example values.
19+
20+
```
21+
DOCKER_REPO=oalders/tester-perl
22+
DOCKER_USERNAME=oalders
23+
DOCKER_GITHUB_TOKEN=a-token-or-password
1624
```
1725

1826
I'm open to adding more testing modules and dependencies if other people find this to be helpful.

bin/build-and-push.sh

-10
This file was deleted.

0 commit comments

Comments
 (0)