-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Limit builds in cicd #1654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Limit builds in cicd #1654
Changes from all commits
0f5cdd9
4ddebf5
450e793
fba27ba
0a0ded7
6ef235d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1 @@ | ||
| # These are supported funding model platforms | ||
|
|
||
| github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
| patreon: # Replace with a single Patreon username | ||
| open_collective: pokeapi | ||
| ko_fi: # Replace with a single Ko-fi username | ||
| tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
| community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
| liberapay: # Replace with a single Liberapay username | ||
| issuehunt: # Replace with a single IssueHunt username | ||
| otechie: # Replace with a single Otechie username | ||
| custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,10 +2,20 @@ name: Database | |
|
|
||
| on: | ||
| pull_request: | ||
| paths: &paths | ||
| - "**.py" | ||
| - "**.toml" | ||
| - "**.lock" | ||
| - "data/**" | ||
| - "Resources/nginx/**" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing the resources docker app dockerfile |
||
| - "docker-compose**" | ||
| - Makefile | ||
| - .github/workflows/database.yml | ||
| push: | ||
| branches-ignore: | ||
| - master | ||
| - staging | ||
| paths: *paths | ||
|
|
||
| jobs: | ||
| csv: | ||
|
|
@@ -66,19 +76,14 @@ jobs: | |
| with: | ||
| submodules: recursive | ||
| - name: Build and start services | ||
| run: | | ||
| docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d --build | ||
| run: make docker-dev-up | ||
| - name: Run migrations and build database | ||
| run: | | ||
| make docker-migrate | ||
| make docker-build-db | ||
| - name: Dump DB | ||
| run: docker compose exec -T db pg_dump -U ash -Fc -N 'hdb_*' pokeapi > pokeapi.dump | ||
| - name: Drop and recreate database | ||
| run: | | ||
| docker compose exec -T db psql -U ash -d postgres -c "DROP DATABASE pokeapi WITH (FORCE);" | ||
| docker compose exec -T db psql -U ash -d postgres -c "CREATE DATABASE pokeapi;" | ||
| run: make docker-dump-db | ||
| - name: Import database | ||
| run: docker compose exec -T db pg_restore -U ash -d pokeapi < pokeapi.dump | ||
| run: make docker-restore-db | ||
| - name: Test data | ||
| run: curl -Ss http://localhost/api/v2/pokemon/1/ | grep -q 'bulbasaur' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,15 @@ name: Publish | |
|
|
||
| on: | ||
| push: | ||
| paths: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just a note if we do ever create a release tag which dosent modify these files the image wont release |
||
| - "**.py" | ||
| - "**.toml" | ||
| - "**.lock" | ||
| - "Resources/docker/**" | ||
| - .github/workflows/docker-build-and-push.yml | ||
| branches: | ||
| - 'master' | ||
| - 'staging' | ||
| - master | ||
| - staging | ||
| tags: | ||
| - '*.*.*' | ||
|
|
||
|
|
@@ -28,7 +34,6 @@ jobs: | |
| id: buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Login to DockerHub | ||
| if: github.event_name != 'pull_request' | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME_NARAMSIM }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,11 @@ name: Release | |
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - "**.py" | ||
| - "data/**" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. toml and lock files here needed if a dep is bumped ever resources docker for the docker image and the uv setup action ps: same issue as with release tag for docker build and publish |
||
| - Makefile | ||
| - .github/workflows/release.yml | ||
| branches: | ||
| - master | ||
|
Naramsim marked this conversation as resolved.
|
||
| tags: | ||
|
|
@@ -18,18 +23,16 @@ jobs: | |
| submodules: recursive | ||
| - name: Start pokeapi (docker) | ||
| run: | | ||
| docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d | ||
| make docker-dev-up | ||
| make docker-migrate | ||
| make docker-build-db | ||
| - name: Dump PG db | ||
| run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash -N 'hdb_*' pokeapi > pokeapi.pgdump" | ||
| - name: Copy PG dump | ||
| run: | | ||
| docker compose cp db:/tmp/pokeapi.pgdump ./ | ||
| ls -larth | ||
| run: make docker-dump-db | ||
| - name: List folder | ||
| run: ls -larth | ||
| - name: Setup uv | ||
| uses: ./.github/actions/setup-uv | ||
| - name: Start pokeapi | ||
| - name: Generate SQLite db | ||
| run: | | ||
| rm -rf .venv | ||
| make install-base | ||
|
|
@@ -38,7 +41,7 @@ jobs: | |
| nohup make serve & | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to |
||
| sleep 3 | ||
| - name: Release tag | ||
| uses: softprops/action-gh-release@v3.0.1 | ||
| uses: softprops/action-gh-release@v3.0.2 | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| with: | ||
| draft: true | ||
|
|
@@ -48,7 +51,7 @@ jobs: | |
| db.sqlite3 | ||
| generate_release_notes: true | ||
| - name: Release master branch | ||
| uses: softprops/action-gh-release@v3.0.1 | ||
| uses: softprops/action-gh-release@v3.0.2 | ||
| if: github.ref == 'refs/heads/master' | ||
| with: | ||
| body: | | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing the uv setup action, database.yml and release.yml is missing it too btw