diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f3660e8..ed396a8 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -56,6 +56,9 @@ jobs: replace_env 'MONGODB_PW' '${{ secrets.MONGODB_PW }}' replace_env 'TOKEN' '${{ secrets.TOKEN }}' + # Append GitHub repository to .env + echo "REPOSITORY=${{ github.repository }}" >> .env + mkdir -p ./astro cp .env ./astro/.env diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index 662b5ce..aa96353 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -35,6 +35,8 @@ services: target: prod volumes: - ./data/media:/prod/dist/media + environment: + - REPOSITORY=${REPOSITORY} labels: - traefik.enable=true - traefik.http.routers.${NAME}-payload.rule=Host(`${PAYLOAD_HOST}`) diff --git a/payload/src/collections/Posts.ts b/payload/src/collections/Posts.ts index af35aaf..95a20fb 100644 --- a/payload/src/collections/Posts.ts +++ b/payload/src/collections/Posts.ts @@ -18,7 +18,7 @@ const Posts: CollectionConfig = { try { console.log( await fetch( - `https://api.github.com/repos/mooxl/${process.env.NAME}/dispatches`, + `https://api.github.com/repos/${process.env.REPOSITORY}/dispatches`, { method: "POST", headers: {