heya
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
parent
d30d3e61b9
commit
2889ccc655
3
.env.dev
3
.env.dev
@ -1,7 +1,6 @@
|
|||||||
ASTRO_TO_PAYLOAD_URL=http://payload:3001
|
|
||||||
PAYLOAD_SECRET=supersecretkey
|
|
||||||
PAYLOAD_URL=http://localhost:3001
|
PAYLOAD_URL=http://localhost:3001
|
||||||
PAYLOAD_PORT=3001
|
PAYLOAD_PORT=3001
|
||||||
|
PAYLOAD_SECRET=supersecretkey
|
||||||
MONGODB_URI=mongodb://payload:test@mongo:27017
|
MONGODB_URI=mongodb://payload:test@mongo:27017
|
||||||
MONGODB_USER=payload
|
MONGODB_USER=payload
|
||||||
MONGODB_PW=test
|
MONGODB_PW=test
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
PAYLOAD_SECRET=supersecretkey
|
|
||||||
PAYLOAD_URL=http://localhost:3001
|
PAYLOAD_URL=http://localhost:3001
|
||||||
PAYLOAD_PORT=3001
|
PAYLOAD_PORT=3001
|
||||||
|
PAYLOAD_SECRET=supersecretkey
|
||||||
MONGODB_URI=mongodb://payload:test@mongo:27017
|
MONGODB_URI=mongodb://payload:test@mongo:27017
|
||||||
MONGODB_USER=payload
|
MONGODB_USER=payload
|
||||||
MONGODB_PW=test
|
MONGODB_PW=test
|
||||||
|
0
.github/workflows/push
vendored
0
.github/workflows/push
vendored
17
.github/workflows/push.yml
vendored
Normal file
17
.github/workflows/push.yml
vendored
Normal file
@ -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
|
@ -1,7 +1,12 @@
|
|||||||
import type { Post } from "../types";
|
import type { Post } from "../types";
|
||||||
|
|
||||||
|
const url =
|
||||||
|
process.env.NODE_ENV === "development"
|
||||||
|
? "http://payload:3001"
|
||||||
|
: `https://${process.env.PAYLOAD_URL}`;
|
||||||
|
|
||||||
export const getPosts = async () =>
|
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) =>
|
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;
|
||||||
|
@ -3,6 +3,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: astro
|
context: astro
|
||||||
target: prod
|
target: prod
|
||||||
|
environment:
|
||||||
|
PAYLOAD_URL: ${PAYLOAD_URL}
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user