-
-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1196 from PokeAPI/pg-dump
Create release on tag with db dump
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Build | ||
run: | | ||
docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d | ||
make docker-migrate | ||
make docker-build-db | ||
- name: Dump DB | ||
run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash pokeapi | gzip > pokeapi.dump.zip" | ||
- name: Copy dump | ||
run: | | ||
docker compose cp db:/tmp/pokeapi.dump.zip ./ | ||
ls -larth | ||
- name: Release | ||
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
draft: true | ||
fail_on_unmatched_files: true | ||
files: pokeapi.dump.zip | ||
generate_release_notes: true |