Skip to content

Commit 32ef39b

Browse files
committed
Fix: to apply .env to right directory
1 parent a2a9b3f commit 32ef39b

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,41 @@ jobs:
1313
- name: Checkout Code
1414
uses: actions/checkout@v3
1515

16+
- name: Create .env file
17+
run: |
18+
echo "DOCKER_HUB_USERNAME=${{ secrets.DOCKER_HUB_USERNAME }}" > .env
19+
echo "NEXT_PUBLIC_GOOGLE_REDIRECT_CLIENT_ID=${{secrets.NEXT_PUBLIC_GOOGLE_REDIRECT_CLIENT_ID}}" >> .env
20+
echo "NEXT_PUBLIC_GOOGLE_REDIRECT_URI=${{secrets.NEXT_PUBLIC_GOOGLE_REDIRECT_URI}}" >> .env
21+
1622
- name: Login to DockerHub (Optional)
1723
uses: docker/login-action@v2
1824
with:
1925
username: ${{ secrets.DOCKER_HUB_USERNAME }}
2026
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
2127

22-
2328
- name: Build and Push Docker Image
2429
run: |
2530
docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/gdgoc-fe-app:latest .
2631
docker run --rm ${{ secrets.DOCKER_HUB_USERNAME }}/gdgoc-fe-app:latest ls -la /app
2732
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/gdgoc-fe-app:latest
2833
29-
3034
- name: Create Deployment Package
3135
run: |
3236
cp scripts/deploy.sh ./deploy.sh
33-
# Create .env file with all required environment variables
34-
echo "DOCKER_HUB_USERNAME=${{ secrets.DOCKER_HUB_USERNAME }}" > .env
35-
echo "NEXT_PUBLIC_GOOGLE_REDIRECT_CLIENT_ID=${{secrets.NEXT_PUBLIC_GOOGLE_REDIRECT_CLIENT_ID}}" >> .env
36-
echo "NEXT_PUBLIC_GOOGLE_REDIRECT_URI=${{secrets.NEXT_PUBLIC_GOOGLE_REDIRECT_URI}}" >> .env
37-
# Add any other environment variables you need here
38-
3937
zip -r deploy.zip .env docker-compose.yml deploy.sh appspec.yml \
4038
Dockerfile package.json package-lock.json next.config.mjs \
4139
pages public .next
4240
43-
44-
4541
- name: Configure AWS credentials
4642
run: |
4743
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
4844
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4945
aws configure set region ${{ secrets.AWS_REGION }}
5046
51-
5247
- name: Upload Deployment Package to S3
5348
run: |
5449
aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_BUCKET }}/deploy.zip
5550
56-
5751
- name: Trigger CodeDeploy (CLI)
5852
env:
5953
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

0 commit comments

Comments
 (0)