Skip to content

actions: oops, have to have a .env file #7

actions: oops, have to have a .env file

actions: oops, have to have a .env file #7

Workflow file for this run

name: Testing with devbox
on:
push:
branches:
- 157-offline-dev
env:
PROJECT_ID: 'benefit-decision-toolkit-play'
REGION: 'us-central1'
SERVICE: 'benefit-decision-toolkit-play'
API_NAME: 'builder-api'
WORKLOAD_IDENTITY_PROVIDER: 'projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create .env file
run: cp .env.example .env
# run: |-
# echo "QUARKUS_GOOGLE_CLOUD_PROJECT_ID=${{ secrets.QUARKUS_GOOGLE_CLOUD_PROJECT_ID }}" >> .env
# instead of copying, we need to use gh secrets to create the .env file with the "real" values
# e.g:
# echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env
# echo "API_KEY=${{ secrets.API_KEY }}" >> .env
# Add other variables as needed
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.12.0
with:
enable-cache: true
# Configure Workload Identity Federation and generate an access token
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'
service_account: cicd-build-deploy-api@benefit-decision-toolkit-play.iam.gserviceaccount.com
project_id: ${{ env.PROJECT_ID }}
- name: 'Use gcloud CLI via Devbox?'
run: 'devbox run -- gcloud info'
# - name: Check devbox env variables
# run: devbox run -- env
# - name: Run a script called test
# run: devbox run setup
- name: Run arbitrary commands
run: devbox run -- echo "done!"