-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
525a195
commit bb365a2
Showing
6 changed files
with
313 additions
and
3 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,49 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
get_tag: | ||
runs-on: ubuntu-latest | ||
output: | ||
tag: ${GITHUB_REF#refs/*/} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set output | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: Check output | ||
env: | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
run: | | ||
echo $RELEASE_VERSION | ||
echo ${{ steps.vars.outputs.tag }} | ||
deploy: | ||
name: deploy_project | ||
runs-on: ubuntu-latest | ||
needs: get_tag | ||
env: | ||
TAG: ${{ needs.get_tag.outputs.tag }} | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Courtcircuits/cluster | ||
token: "${{ secrets.DEPLOYMENT_TOKEN }}" | ||
- name: Update values.yaml | ||
run: | | ||
sudo add-apt-repository ppa:rmescandon/yq | ||
sudo apt update | ||
sudo apt install yq -y | ||
cd projects/gists/gists | ||
yq eval -i '.tag = env(TAG)' tag.yaml | ||
git config --global user.name "GIST Bot" | ||
git config --global user.email "[email protected]" | ||
git add tag.yaml | ||
git commit -m "api gist | ${{ env.TAG }} | ${{ github.event.head_commit.message }}" | ||
git push |
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 |
---|---|---|
@@ -1,5 +1,26 @@ | ||
# Gists.app API - Code snippets and scripts safe | ||
|
||
## Usage | ||
|
||
Check the [API documentation](http://localhost:4000) for more information (for now this page is hosted locally, so please run the project before accessing the documentation). | ||
|
||
## Quick Start | ||
|
||
### Pre-requisites | ||
|
||
- Go (version 1.22+) | ||
- Air | ||
- docker compose | ||
- migrate | ||
|
||
### Onboarding script | ||
|
||
```bash | ||
docker compose up -d | ||
migrate -path=migrations -database "postgresql://postgres:[email protected]:5432/gists?sslmode=disable" -verbose up | ||
air | ||
``` | ||
|
||
## Installation | ||
|
||
1. Make sure that you have `air` | ||
|
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,223 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "gist.app API reference", | ||
"description": "Share and publish your scripts and code snippets in one curl.", | ||
"version": "1.0.0" | ||
}, | ||
"tags": [], | ||
"paths": { | ||
"/gists": { | ||
"post": { | ||
"summary": "Create a gist", | ||
"deprecated": false, | ||
"description": "", | ||
"tags": [], | ||
"parameters": [], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string", "description": "name" }, | ||
"content": { "type": "string" } | ||
}, | ||
"required": ["name", "content"] | ||
}, | ||
"example": { | ||
"name": "temporibus sit amet", | ||
"content": "Similique veniam illum laudantium sit. Officiis vitae esse accusantium. Deserunt hic distinctio dolores eos delectus enim reprehenderit sunt. Saepe doloremque iusto accusamus praesentium. Non deserunt aspernatur voluptate dolorem voluptas repellat quo nam modi. Nihil perferendis sapiente officiis quam voluptas ducimus tempora velit quaerat." | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"description": "Created", | ||
"content": { | ||
"application/json": { | ||
"schema": { "$ref": "#/components/schemas/Gist" } | ||
} | ||
} | ||
} | ||
}, | ||
"security": [] | ||
}, | ||
"get": { | ||
"summary": "Get all gists", | ||
"deprecated": false, | ||
"description": "", | ||
"tags": [], | ||
"parameters": [], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { "$ref": "#/components/schemas/Gist" } | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"security": [] | ||
} | ||
}, | ||
"/gists/{id}/name": { | ||
"patch": { | ||
"summary": "Update gist's name", | ||
"deprecated": false, | ||
"description": "", | ||
"tags": [], | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "", | ||
"required": true, | ||
"example": "1", | ||
"schema": { "type": "string" } | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string", "description": "name" } | ||
}, | ||
"required": ["name"] | ||
}, | ||
"example": { "name": "doloremque dolorum nobis" } | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { "schema": { "type": "string" } } | ||
} | ||
} | ||
}, | ||
"security": [] | ||
} | ||
}, | ||
"/gists/{id}/content": { | ||
"patch": { | ||
"summary": "Update gist's content", | ||
"deprecated": false, | ||
"description": "", | ||
"tags": [], | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "", | ||
"required": true, | ||
"example": "1", | ||
"schema": { "type": "string" } | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string", "description": "name" } | ||
}, | ||
"required": ["name"] | ||
}, | ||
"example": { "content": "ezaeeza" } | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { "schema": { "type": "string" } } | ||
} | ||
} | ||
}, | ||
"security": [] | ||
} | ||
}, | ||
"/gists/{id}": { | ||
"get": { | ||
"summary": "Get a gist", | ||
"deprecated": false, | ||
"description": "", | ||
"tags": [], | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "", | ||
"required": true, | ||
"example": "2", | ||
"schema": { "type": "string" } | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { "$ref": "#/components/schemas/Gist" } | ||
} | ||
} | ||
} | ||
}, | ||
"security": [] | ||
}, | ||
"delete": { | ||
"summary": "Delete a gist", | ||
"deprecated": false, | ||
"description": "", | ||
"tags": [], | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "", | ||
"required": true, | ||
"example": "1", | ||
"schema": { "type": "string" } | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { "type": "object", "properties": {} } | ||
} | ||
} | ||
} | ||
}, | ||
"security": [] | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Gist": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string", "description": "ID" }, | ||
"name": { "type": "string", "description": "name" }, | ||
"content": { "type": "string", "description": "content" } | ||
}, | ||
"required": ["id", "name", "content"] | ||
} | ||
}, | ||
"securitySchemes": {} | ||
}, | ||
"servers": [] | ||
} |
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
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
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