0
0
Fork 0
mirror of https://github.com/tj-actions/pg-dump.git synced 2025-06-11 13:12:32 +00:00

Initial commit.

This commit is contained in:
Tonye Jack 2021-01-30 21:26:56 -05:00
commit 4ed55614ba
11 changed files with 221 additions and 0 deletions

18
.github/workflows/rebase.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Automatic Rebase
on:
issue_comment:
types: [created]
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_TOKEN }}
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.4
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

View file

@ -0,0 +1,27 @@
name: Update release version.
on:
release:
types: [published]
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bumpversion release version
uses: tj-actions/bumpversion@v7.1
id: bumpversion
with:
pattern: 'tj-actions/pg-dump@'
paths: |
README.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
base: "main"
title: "Upgraded to ${{ steps.bumpversion.outputs.new_version }}"
branch: "upgrade-to-${{ steps.bumpversion.outputs.new_version }}"
commit-message: "Upgraded from ${{ steps.bumpversion.outputs.old_version }} -> ${{ steps.bumpversion.outputs.new_version }}"
body: "View [CHANGES](https://github.com/${{ github.repository }}/compare/${{ steps.bumpversion.outputs.old_version }}...${{ steps.bumpversion.outputs.new_version }})"
token: ${{ secrets.PAT_TOKEN }}

55
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Test postgres-restore
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_user_password
POSTGRES_DB: testdb
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run pg_dump
uses: ./
with:
database_url: "postgres://test_user:test_user_password@localhost:5432/testdb"
path: "backups/backup.sql"
- name: Check changes to backup file.
id: changed_backup
uses: tj-actions/verify-changed-files@v5.1
with:
files: backups/backup.sql
- name: Commit changes to backup file.
if: steps.changed_backup.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add backups/backup.sql
git commit -m "Auto update backup.sql."
- name: Push changes
if: steps.changed_backup.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT_TOKEN }}
branch: ${{ github.head_ref }}