Skip to content

Commit

Permalink
Use GitHub action to build and publish the images
Browse files Browse the repository at this point in the history
once merged/clone you have to define the following
GitHub secrets variables: (adjust values if needed)

    DOCKER_REPO
    DOCKER_USERNAME
    DOCKER_GITHUB_TOKEN
  • Loading branch information
atoomic committed Jan 16, 2020
1 parent 23baf5f commit 8af40b7
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 13 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-to-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# https://github.com/marketplace/actions/publish-docker

name: Publish to Docker
on: [push]
jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
perl-version:
- '5.30'
- '5.28'
- '5.26'
- '5.24'
- '5.22'
- '5.20'
- '5.18'
- '5.16'
- '5.14'
- '5.12'
- '5.10'
- '5.8'

steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: ${{ secrets.DOCKER_REPO }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
dockerfile: Dockerfile
buildargs: BASE=${{ matrix.perl-version }}
tags: "v${{ matrix.perl-version }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ pre-installed bits:
* various testing modules (see `cpanfile` in this repo)


To build and push:
```bash
./bin/build-and-push.sh
## Building Docker images

When pushing to GitHub, it's using a GitHub action `.github/workflows/publish-to-docker.yml`
to automagically build and publish the docker images for you.

You would have to set in your GitHub repository the following secret variables, with some example values.

```
DOCKER_REPO=oalders/tester-perl
DOCKER_USERNAME=oalders
DOCKER_GITHUB_TOKEN=a-token-or-password
```

I'm open to adding more testing modules and dependencies if other people find this to be helpful.
Expand Down
10 changes: 0 additions & 10 deletions bin/build-and-push.sh

This file was deleted.

0 comments on commit 8af40b7

Please sign in to comment.