Add v8 #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker image build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
COURIER_REPO: nyaruka/courier | |
GREP_TIMEOUT: 60 | |
strategy: | |
matrix: | |
COURIER_VERSION: ["6.0.0", "6.2.2", "6.4.0", "7.0.0", "7.2.0", "7.4.0", "8.0.0", "8.0.2"] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: docker/setup-buildx-action@v1 | |
- name: Run Redis | |
run: docker run --name redis -d -p 6379:6379 redis:3.2.4 | |
- name: Install PostgreSQL | |
uses: nyaruka/postgis-action@v2 | |
with: | |
postgresql version: "13" | |
postgis version: "3.1" | |
postgresql db: temba | |
postgresql user: temba | |
postgresql password: temba | |
- name: Build image | |
uses: docker/build-push-action@v2 | |
with: | |
push: false | |
load: true | |
context: . | |
tags: courier | |
build-args: | | |
COURIER_REPO=${{env.COURIER_REPO}} | |
COURIER_VERSION=${{matrix.COURIER_VERSION}} | |
- name: Test image | |
run: | | |
docker run --name courier --env-file docker.envfile --link postgis --link redis --publish 8080:8080 --detach courier | |
timeout ${{env.GREP_TIMEOUT}} grep -m 1 'server listening on 8080' <(docker logs --follow courier 2>&1) | |
curl http://localhost:8080/ | grep -m 1 ${{matrix.COURIER_VERSION}} | |
- name: debug outputs | |
if: always() | |
run: | | |
docker ps | |
docker images | |
docker logs courier | |
- name: Create image tags | |
uses: docker/metadata-action@v3 | |
id: tags | |
with: | |
images: | | |
praekeltfoundation/courier | |
ghcr.io/praekeltfoundation/courier-docker | |
tags: | | |
type=pep440,pattern=v{{major}},value=${{matrix.COURIER_VERSION}} | |
type=pep440,pattern=v{{major}}.{{minor}},value=${{matrix.COURIER_VERSION}} | |
type=pep440,pattern=v{{version}},value=${{matrix.COURIER_VERSION}} | |
- name: login to ghcr | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: login to docker hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{secrets.DOCKER_USERNAME}} | |
password: ${{secrets.DOCKER_PASSWORD}} | |
- name: Build and push image | |
uses: docker/build-push-action@v2 | |
with: | |
push: ${{github.event_name != 'pull_request'}} | |
tags: ${{steps.tags.outputs.tags}} | |
context: . | |
build-args: | | |
COURIER_REPO=${{env.COURIER_REPO}} | |
COURIER_VERSION=${{matrix.COURIER_VERSION}} |