Add v8.0.0 to build matrix #18
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: | |
ARCHIVER_REPO: nyaruka/rp-archiver | |
GREP_TIMEOUT: 60 | |
PGPASSWORD: temba | |
strategy: | |
matrix: | |
ARCHIVER_VERSION: ["8.0.0"] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: docker/setup-buildx-action@v1 | |
- 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: FakeS3 | |
env: | |
SERVICES: s3 | |
run: | | |
pip install localstack awscli-local | |
localstack start -d | |
localstack wait -t 30 | |
awslocal s3api create-bucket --bucket dl-archiver-test | |
- name: Build image | |
uses: docker/build-push-action@v2 | |
with: | |
push: false | |
load: true | |
context: . | |
tags: archiver | |
build-args: | | |
ARCHIVER_REPO=${{env.ARCHIVER_REPO}} | |
ARCHIVER_VERSION=${{matrix.ARCHIVER_VERSION}} | |
- name: Create postgresql tables | |
run: | | |
psql -h localhost -d temba -U temba -f ci/database.sql | |
- name: Test image | |
run: | | |
docker run --name archiver --env-file docker.envfile --link postgis --link localstack-main --publish 8080:8080 --detach archiver | |
timeout ${{env.GREP_TIMEOUT}} grep -m 1 's3 bucket ok' <(docker logs --follow archiver 2>&1) | |
timeout ${{env.GREP_TIMEOUT}} grep -m 1 'Sleeping until next UTC day' <(docker logs --follow archiver 2>&1) | |
grep -v 'error' <(docker logs archiver 2>&1) | |
- name: debug outputs | |
if: always() | |
run: | | |
docker ps | |
docker images | |
docker logs archiver | |
docker logs localstack-main | |
- name: Create image tags | |
uses: docker/metadata-action@v3 | |
id: tags | |
with: | |
images: | | |
praekeltfoundation/rp-archiver | |
ghcr.io/praekeltfoundation/rp-archiver-docker | |
tags: | | |
type=pep440,pattern=v{{major}},value=${{matrix.ARCHIVER_VERSION}} | |
type=pep440,pattern=v{{major}}.{{minor}},value=${{matrix.ARCHIVER_VERSION}} | |
type=pep440,pattern=v{{version}},value=${{matrix.ARCHIVER_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: | | |
ARCHIVER_REPO=${{env.ARCHIVER_REPO}} | |
ARCHIVER_VERSION=${{matrix.ARCHIVER_VERSION}} |