Skip to content

Commit

Permalink
Merge pull request #23 from dotslashf:development
Browse files Browse the repository at this point in the history
chore: include env
  • Loading branch information
dotslashf authored Aug 17, 2024
2 parents 0f01a83 + d775ad2 commit 06f780d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,25 @@ jobs:
- name: Deploy to VM
run: |
# create env file
echo NODE_ENV=production >> .env
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env
echo DISCORD_API_CLIENT_ID=${{ secrets.DISCORD_API_CLIENT_ID }} >> .env
echo DISCORD_API_CLIENT_SECRET=${{ secrets.DISCORD_API_CLIENT_SECRET }} >> .env
echo GOOGLE_API_CLIENT_ID=${{ secrets.GOOGLE_API_CLIENT_ID }} >> .env
echo GOOGLE_API_CLIENT_SECRET=${{ secrets.GOOGLE_API_CLIENT_SECRET }} >> .env
echo NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} >> .env
echo NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }} >> .env
echo REDIS_HOST_URL=${{ secrets.REDIS_HOST_URL }} >> .env
echo REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }} >> .env
echo TWITTER_API_KEY=${{ secrets.TWITTER_API_KEY }} >> .env
echo TWITTER_API_SECRET=${{ secrets.TWITTER_API_SECRET }} >> .env
gcloud compute ssh --zone $GCE_INSTANCE_ZONE $GCE_INSTANCE --command '
# Pull the new image
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev
docker pull ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/arsip-template/app:${{ github.sha }}
docker stop arsip-template || true
docker rm arsip-template || true
docker run -d --name arsip-template -p 3000:3000 gcr.io/${{ env.PROJECT_ID }}/arsip-template:${{ github.sha }}
docker run -d --name arsip-template -p 3000:3000 --env-file .env ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/arsip-template/app:${{ github.sha }}
'

0 comments on commit 06f780d

Please sign in to comment.