Build PostgreSQL images #107
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: Build PostgreSQL images | |
on: | |
# trigger every sunday morning | |
schedule: | |
- cron: "2 2 * * SUN" | |
# trigger on PR merge and push to master branch | |
push: | |
branches: | |
- master | |
# trigger on PR | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-and-push: | |
if: github.event_name == 'push' || github.event_name == 'schedule' | |
runs-on: ubuntu-latest | |
timeout-minutes: 120 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Log in to GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Log in to Docker Hub | |
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login docker.io -u dockerc2c --password-stdin | |
- name: Build and push with Docker | |
run: make PUSH_DOCKER_HUB=true PUSH_GHCR=true | |
build-on-pr: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
timeout-minutes: 120 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build without pushing | |
run: make |