Skip to content

Commit

Permalink
Add GitHub Actions workflows for code formatting and service deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Zingzy committed Jan 18, 2024
1 parent e5b323e commit 505d542
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Format Code

on:
push:
branches:
- main # Change this to your main branch name

jobs:
format_code:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install black
- name: Format Python Files
run: black .
12 changes: 12 additions & 0 deletions .github/workflows/render.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
- type: web
name: panda-api
runtime: python
scaling:
minInstances: 1
maxInstances: 3
buildCommand: pip install -r requirements.txt
startCommand: uvicorn main:app
preDeployCommand: pip install uvicorn

envVarGroups:
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<td align="center"><img src="https://pandaa.vercel.app/raw_pic" style="height: 220px;"></td>
<tr>
<tr>
<td>😉 random pic using our api ⬆️</td>
<td align="center">⬆️ random pic using our api 😉</td>
</tr>
</table>

Expand Down Expand Up @@ -63,6 +63,9 @@ _For a more detailed API visit : https://pandaa.vercel.app/docs_
### Direct Deployment

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/Zingzy/panda-api)
<a href="https://render.com/deploy?repo=https://github.com/Zingzy/panda-api">
<img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render" height="30px"/>
</a>

### Manual Setup
1. Clone the repository `git clone https://github.com/Zingzy/panda-api.git`.
Expand All @@ -74,4 +77,14 @@ _For a more detailed API visit : https://pandaa.vercel.app/docs_

Feel free to contribute to the Panda API by adding more panda facts, pictures, or improving the code. Create a pull request, and let's make the panda world even more delightful! 🎉🐼

## Submission Guidelines

- Create a new branch for your changes.
- Make sure your code is formatted using [Black Formatter](https://pypi.org/project/black/)
- If you are adding a new panda fact, add it to the `facts.txt` file in a new line, ending with a full stop.
- If you are adding a new panda picture, add it to the `pics` folder.
- The picture filename should be in the format `{number}.jpg`, where `{number}` is the next number in the sequence.
- The picture should not be more than 300 KB in size.


**Enjoy the Panda API! 🐼✨**

0 comments on commit 505d542

Please sign in to comment.