Skip to content

Commit 97db2fb

Browse files
committed
PR時にも動くように
1 parent 1336e81 commit 97db2fb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/pg_dump.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Backup PostgreSQL Database
33
on:
44
schedule:
55
- cron: "0 19 * * *" # 毎日午前2時に実行
6+
pull_request: # PR 作成や更新時にトリガー
7+
branches:
8+
- main
9+
push: # 通常の push 時にもトリガー
10+
branches:
11+
- main
612

713
jobs:
814
backup:
@@ -12,14 +18,15 @@ jobs:
1218
- name: Checkout code
1319
uses: actions/checkout@v3
1420

15-
- name: Install PostgreSQL
21+
- name: Install PostgreSQL Client
1622
run: |
1723
sudo apt-get update
1824
sudo apt-get install -y postgresql-client
1925
2026
- name: Backup database
2127
run: |
2228
pg_dump -h ${{ secrets.PG_HOST }} \
29+
-p ${{ secrets.PG_PORT }} \
2330
-U ${{ secrets.PG_USER }} \
2431
-d ${{ secrets.PG_DB }} \
2532
--file=backup.sql

0 commit comments

Comments
 (0)