- DevOps Assignment -
-- Status: - -
-- Backend URL: - http://localhost:8000 -
-diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 13cba5f79..b755be3e3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,7 +20,6 @@ jobs: steps: - uses: actions/checkout@v4 - # --- AWS Login & Push --- - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -32,7 +31,6 @@ jobs: id: login-ecr uses: aws-actions/amazon-ecr-login@v2 - - name: Build and push Backend to ECR if: steps.login-ecr.outcome == 'success' uses: docker/build-push-action@v5 @@ -53,7 +51,6 @@ jobs: ${{ steps.login-ecr.outputs.registry }}/devops-frontend:${{ github.sha }} ${{ steps.login-ecr.outputs.registry }}/devops-frontend:latest - # --- GCP Login & Push --- - name: Google Auth uses: google-github-actions/auth@v2 with: @@ -65,7 +62,7 @@ jobs: continue-on-error: true - name: Enable GCP Services - run: gcloud services enable artifactregistry.googleapis.com compute.googleapis.com secretmanager.googleapis.com + run: gcloud services enable artifactregistry.googleapis.com compute.googleapis.com secretmanager.googleapis.com run.googleapis.com continue-on-error: true - name: Configure Docker for GCP @@ -100,16 +97,25 @@ jobs: - name: Setup Terraform uses: hashicorp/setup-terraform@v3 - - - name: Create Backend Bucket + + - name: Google Auth + uses: google-github-actions/auth@v2 + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v2 + + - name: Create State Bucket run: | - gcloud storage buckets create gs://devops-assignment-tf-state --location=us-central1 || true - continue-on-error: true + gcloud storage buckets create gs://devops-assignment-tf-state --location=us-central1 2>/dev/null || echo "Bucket already exists" - name: Terraform Init GCP run: | cd terraform/gcp terraform init + env: + GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} - name: Terraform Apply GCP run: | @@ -121,6 +127,13 @@ jobs: TF_VAR_database_secret: ${{ secrets.DATABASE_SECRET }} GOOGLE_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + - name: Terraform Init AWS run: | cd terraform/aws @@ -136,4 +149,3 @@ jobs: TF_VAR_db_password: ${{ secrets.DB_PASSWORD }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - diff --git a/frontend/__tests__/__snapshots__/snapshot.test.js.snap b/frontend/__tests__/__snapshots__/snapshot.test.js.snap index bd921250e..44257211b 100644 --- a/frontend/__tests__/__snapshots__/snapshot.test.js.snap +++ b/frontend/__tests__/__snapshots__/snapshot.test.js.snap @@ -1,55 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Home Snapshot matches snapshot 1`] = ` -
- Status: - -
-- Backend URL: - http://localhost:8000 -
-Status:
Backend URL: http://localhost:8000