Vizzuality/landgriffon

View on GitHub
.github/workflows/build-database-docker.yml

Summary

Maintainability
Test Coverage
name: Build database docker image
on:
  push:
    paths:
      - 'database/**'
  workflow_dispatch:

env:
  PG_H3_VERSION: 3.7.2

jobs:
  testing-api:
    name: Build database docker image
    runs-on: ubuntu-20.04
    timeout-minutes: 15

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Log in to Docker Hub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Push to Docker Hub
        uses: docker/build-push-action@v2
        with:
          context: database
          push: true
          tags: vizzuality/landgriffon-database:${{ github.ref != 'refs/heads/main' && 'staging' || 'production' }}

      - name: Push "latest" tag to Docker Hub
        if: ${{ github.ref == 'refs/heads/main' }}
        uses: docker/build-push-action@v2
        with:
          context: database
          push: true
          tags: vizzuality/landgriffon-database:latest