github actions: supply psql password #9
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: pgcrypsi CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
docker-build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: wuriyanto/postgres-pgcrypsi:latest | |
test: | |
name: Test | |
needs: docker-build | |
runs-on: ubuntu-20.04 | |
services: | |
postgres: | |
image: wuriyanto/postgres-pgcrypsi:latest | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
- name: Install Postgre Client | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes --no-install-recommends postgresql-client | |
- name: Test | |
run: | | |
export PGPASSWORD='12345678' psql -h localhost -U superdevuser -d superdevdb -a -f ./scripts/test.sql |