-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
- Loading branch information
Showing
6 changed files
with
28 additions
and
5 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
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
Empty file.
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,17 @@ | ||
name: Clone or pull repository | ||
on: | ||
branches: | ||
- prod | ||
jobs: | ||
build: | ||
name: Run remote SSH command | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger build via ssh | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USER }} | ||
key: ${{ secrets.KEY }} | ||
script: | | ||
ls |
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,7 +1,12 @@ | ||
import type { Post } from "../types"; | ||
|
||
const url = | ||
process.env.NODE_ENV === "development" | ||
? "http://payload:3001" | ||
: `https://${process.env.PAYLOAD_URL}`; | ||
|
||
export const getPosts = async () => | ||
(await (await fetch("http://payload:3001/api/posts")).json()).docs as Post[]; | ||
(await (await fetch(`${url}/api/posts`)).json()).docs as Post[]; | ||
|
||
export const getPost = async (id: string) => | ||
(await (await fetch(`http://payload:3001/api/posts/${id}`)).json()) as Post; | ||
(await (await fetch(`${url}/api/posts/${id}`)).json()) as Post; |
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