diff --git a/.github/workflows/aws-deploy-stg.yml b/.github/workflows/aws-deploy-stg.yml index cae7f7c..650800a 100644 --- a/.github/workflows/aws-deploy-stg.yml +++ b/.github/workflows/aws-deploy-stg.yml @@ -30,6 +30,33 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + env: + PORT: ${{ secrets.PORT }} + MONGODB_URI: ${{ secrets.MONGODB_URI }} + FULLCHAIN: ${{ secrets.FULLCHAIN }} + PRIVKEY: ${{ secrets.PRIVKEY }} + DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }} + DISCORD_CLIENT_SECRET: ${{ secrets.DISCORD_CLIENT_SECRET }} + DISCORD_REDIRECT_URI: ${{ secrets.DISCORD_REDIRECT_URI }} + JWT_SECRET: ${{ secrets.JWT_SECRET }} + CLIENT_REDIRECT_URI: ${{ secrets.CLIENT_REDIRECT_URI }} + TOKEN: ${{ secrets.TOKEN }} + DIRECT_URL: ${{ secrets.DIRECT_URL }} + HOSTED_URL: ${{ secrets.HOSTED_URL }} + + run: | + sed -i "s//$MONGODB_URI/g" .github/workflows/td.json + sed -i "s//$PORT/g" .github/workflows/td.json + sed -i "s//$FULLCHAIN/g" .github/workflows/td.json + sed -i "s//$PRIVKEY/g" .github/workflows/td.json + sed -i "s//$DISCORD_CLIENT_ID/g" .github/workflows/td.json + sed -i "s//$DISCORD_CLIENT_SECRET/g" .github/workflows/td.json + sed -i "s//$JWT_SECRET/g" .github/workflows/td.json + sed -i "s//$CLIENT_REDIRECT_URI/g" .github/workflows/td.json + sed -i "s/TOKEN>/$TOKENI/g" .github/workflows/td.json + sed -i "s//$DIRECT_URL/g" .github/workflows/td.json + sed -i "s//$HOSTED_UR/g".github/workflows/td.json + sed -i "s//$DISCORD_REDIRECT_URI/g" .github/workflows/td.json - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83 diff --git a/.github/workflows/td.json b/.github/workflows/td.json index 19975d7..b99484e 100644 --- a/.github/workflows/td.json +++ b/.github/workflows/td.json @@ -14,7 +14,53 @@ } ], "essential": true, - "environment": [], + "environment": [ + + { + "name": "PORT", + "value": "" + }, + { + "name": "FULLCHAIN", + "value": "" + }, + { + "name": "PRIVKEY", + "value": "" + }, + { + "name": "DISCORD_CLIENT_ID", + "value": "" + }, + { + "name": "DISCORD_CLIENT_SECRET", + "value": "" + }, + { + "name": "DISCORD_REDIRECT_URI", + "value": "" + }, + { + "name": "JWT_SECRET", + "value": "" + }, + { + "name": "CLIENT_REDIRECT_URI", + "value": "" + }, + { + "name": "TOKEN", + "value": "" + }, + { + "name": "DIRECT_URL", + "value": "" + }, + { + "name": "HOSTED_URL", + "value": "" + } + ], "mountPoints": [], "volumesFrom": [], "logConfiguration": { diff --git a/bin/www b/bin/www index aacee14..f9e610e 100644 --- a/bin/www +++ b/bin/www @@ -16,7 +16,7 @@ dotenv.config(); const port = process.env.PORT || 3000; (async () => { - + console.log(process.env.MONGODB_URI) mongoose.connect(process.env.MONGODB_URI) const server = https.createServer(options, app); diff --git a/bin/www-dev b/bin/www-dev index a67cc9e..1d28be1 100644 --- a/bin/www-dev +++ b/bin/www-dev @@ -7,7 +7,7 @@ dotenv.config(); const port = process.env.PORT || 3000; (async () => { - + console.log(process.env.MONGODB_URI) mongoose.connect(process.env.MONGODB_URI) app.listen(port, () => {