Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lalelisealstad committed Sep 28, 2024
1 parent d4ef48b commit 8e7d942
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/terraform-pyspark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

# Authenticate using the correct auth action
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }} # Use the secret for your service account key

# Set up Google Cloud SDK without specifying the service account key
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: "liqour-store-etl"
service_account_key: ${{ secrets.GCP_SA_KEY }} # Store GCP credentials as a secret

- name: Authenticate with Google Cloud
run: gcloud auth activate-service-account --key-file=${{ secrets.GCP_SA_KEY }}

- name: Install Terraform
run: sudo apt-get install terraform
Expand All @@ -34,10 +37,10 @@ jobs:
# Step to upload the PySpark job script from GitHub repo to the GCS bucket
- name: Upload PySpark job to GCS
run: |
gsutil cp main.py.py gs://liquor-store-data-bucket/main.py.py
gsutil cp pyspark-job.py gs://liquor-store-data-bucket/main.py
# Submit the PySpark job to Dataproc
- name: Submit PySpark Job
run: |
gcloud dataproc jobs submit pyspark gs://liquor-store-data-bucket/main.py.py \
gcloud dataproc jobs submit pyspark gs://liquor-store-data-bucket/main.py \
--cluster=liquor-store-dataproc-cluster --region=europe-west1

0 comments on commit 8e7d942

Please sign in to comment.