Add v8.0.0 #25
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: | |
MAILROOM_REPO: rapidpro/mailroom | |
GREP_TIMEOUT: 60 | |
strategy: | |
matrix: | |
MAILROOM_VERSION: ["6.0.3", "6.2.3", "6.4.3", "7.0.1", "7.2.6", "7.4.1", "8.0.0"] | |
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: mailroom | |
build-args: | | |
MAILROOM_REPO=${{env.MAILROOM_REPO}} | |
MAILROOM_VERSION=${{matrix.MAILROOM_VERSION}} | |
- name: Test image | |
run: | | |
docker run --name mailroom --env-file docker.envfile --link postgis --link redis --publish 8090:8090 --detach mailroom | |
timeout ${{env.GREP_TIMEOUT}} grep -m 1 'mailroom started' <(docker logs --follow mailroom 2>&1) | |
curl http://localhost:8090/ | grep -m 1 'mailroom' | |
curl http://localhost:8090/ | grep -m 1 ${{matrix.MAILROOM_VERSION}} | |
- name: debug outputs | |
if: always() | |
run: | | |
docker ps | |
docker images | |
docker logs mailroom | |
- name: Create image tags | |
uses: docker/metadata-action@v3 | |
id: tags | |
with: | |
images: | | |
praekeltfoundation/mailroom | |
ghcr.io/praekeltfoundation/mailroom-docker | |
tags: | | |
type=pep440,pattern=v{{major}},value=${{matrix.MAILROOM_VERSION}} | |
type=pep440,pattern=v{{major}}.{{minor}},value=${{matrix.MAILROOM_VERSION}} | |
type=pep440,pattern=v{{version}},value=${{matrix.MAILROOM_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: | | |
MAILROOM_REPO=${{env.MAILROOM_REPO}} | |
MAILROOM_VERSION=${{matrix.MAILROOM_VERSION}} |