Skip to content

Commit 16a6869

Browse files
authored
Merge pull request #1196 from PokeAPI/pg-dump
Create release on tag with db dump
2 parents e2950e8 + 86195f3 commit 16a6869

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
- name: Build
17+
run: |
18+
docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d
19+
make docker-migrate
20+
make docker-build-db
21+
- name: Dump DB
22+
run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash pokeapi | gzip > pokeapi.dump.zip"
23+
- name: Copy dump
24+
run: |
25+
docker compose cp db:/tmp/pokeapi.dump.zip ./
26+
ls -larth
27+
- name: Release
28+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda
29+
if: startsWith(github.ref, 'refs/tags/')
30+
with:
31+
draft: true
32+
fail_on_unmatched_files: true
33+
files: pokeapi.dump.zip
34+
generate_release_notes: true

0 commit comments

Comments
 (0)