-
Notifications
You must be signed in to change notification settings - Fork 1
Add GitHub Actions CI/CD workflows #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0a29952
4e2accb
0d4dfd6
0ffb21c
b91d061
ef30d1a
4e7ee48
c09d619
d62258f
41fd1bc
ab54fb5
f17c23d
98a57ae
b3531c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ defaults: | |
| GOOGLE_PROJECT_ID: "excellent-zoo-300106" | ||
| GOOGLE_COMPUTE_ZONE: "us-central1-a" | ||
| GOOGLE_CLUSTER_NAME: "ipno" | ||
| CLOUDSDK_CORE_DISABLE_PROMPTS: "1" | ||
| - &set-push-env | ||
| USER_NAME: "East Agile" | ||
| USER_EMAIL: "[email protected]" | ||
|
|
@@ -148,7 +149,7 @@ jobs: | |
| django_migrate: | ||
| description: Migrate database | ||
| machine: | ||
| image: ubuntu-2004:202010-01 | ||
| image: ubuntu-2204:current | ||
| environment: *gcloud-env | ||
| steps: | ||
| - run: *set-gcloud-service-key | ||
|
|
@@ -169,7 +170,7 @@ jobs: | |
| django_collect_static: | ||
| description: Collect static | ||
| machine: | ||
| image: ubuntu-2004:202010-01 | ||
| image: ubuntu-2204:current | ||
| environment: *gcloud-env | ||
| steps: | ||
| - run: *set-gcloud-service-key | ||
|
|
@@ -190,7 +191,7 @@ jobs: | |
| deploy: | ||
| description: Deploy application to Google Kubernetes Engine | ||
| machine: | ||
| image: ubuntu-2004:202010-01 | ||
| image: ubuntu-2204:current | ||
| environment: *gcloud-env | ||
| steps: | ||
| - checkout | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,256 @@ | ||||||||||||||||||||||||
| name: Deploy | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||
| - staging | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||
| GOOGLE_PROJECT_ID: excellent-zoo-300106 | ||||||||||||||||||||||||
| GOOGLE_COMPUTE_ZONE: us-central1-a | ||||||||||||||||||||||||
| GOOGLE_CLUSTER_NAME: ipno | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||
| postgres: | ||||||||||||||||||||||||
| image: postgres:13.7 | ||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||
| POSTGRES_USER: ipno | ||||||||||||||||||||||||
| POSTGRES_DB: ipno | ||||||||||||||||||||||||
| POSTGRES_PASSWORD: password | ||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||
| - 5432:5432 | ||||||||||||||||||||||||
| options: >- | ||||||||||||||||||||||||
| --health-cmd pg_isready | ||||||||||||||||||||||||
| --health-interval 10s | ||||||||||||||||||||||||
| --health-timeout 5s | ||||||||||||||||||||||||
| --health-retries 5 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| elasticsearch: | ||||||||||||||||||||||||
| image: elasticsearch:7.10.1 | ||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||
| discovery.type: single-node | ||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||
| - 9200:9200 | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| - 9200:9200 | |
| - 9200:9200 | |
| options: >- | |
| --health-cmd "curl -f http://localhost:9200/_cluster/health" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The redis service in the deploy workflow is missing health check configuration, while the test.yml workflow includes it. This could cause the tests to fail intermittently if they run before Redis is fully ready.
Add the health check options:
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5| - 6379:6379 | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decode service key before google-github-actions/auth
The deploy workflow feeds GCLOUD_SERVICE_KEY_BASE64 directly into google-github-actions/auth (credentials_json: ${{ secrets.GCLOUD_SERVICE_KEY_BASE64 }} at build step). The auth action expects the raw service-account JSON, not a base64 blob; the repository docs still instruct storing this secret base64‑encoded (docs/circleci.md, “cat <gcloud-credentials.json> | base64”). With the secret in that documented format, the action will fail to parse the credentials and every step that needs GCP (image push, migrations, deploy) will error out before running.
Useful? React with 👍 / 👎.
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The credentials_json parameter expects raw JSON content, but based on the CircleCI configuration and documentation (see docs/circleci.md and .circleci/config.yml lines 19, 122), GCLOUD_SERVICE_KEY_BASE64 contains base64-encoded credentials that need to be decoded first.
The Google GitHub Actions auth action cannot directly use base64-encoded credentials. You have two options:
- Recommended: Create a new secret
GCLOUD_SERVICE_KEYwith the decoded JSON content and use it:
credentials_json: ${{ secrets.GCLOUD_SERVICE_KEY }}- Alternative: If you must keep the base64-encoded secret, decode it inline (though this is less clean):
- name: Decode GCloud credentials
run: echo "${{ secrets.GCLOUD_SERVICE_KEY_BASE64 }}" | base64 -d > /tmp/gcloud-key.json
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ steps.decode.outputs.key }}This issue affects all four auth steps in this workflow (lines 118, 152, 181, 210).
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GCLOUD_SERVICE_KEY_BASE64 }} | |
| - name: Decode GCloud credentials | |
| run: echo "${{ secrets.GCLOUD_SERVICE_KEY_BASE64 }}" | base64 -d > /tmp/gcloud-key.json | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ readFile('/tmp/gcloud-key.json') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sensitive information like Google Project ID is hardcoded in the workflow file. While this may not be highly sensitive, it's a best practice to store such configuration in GitHub secrets or variables to make it easier to change without modifying the workflow file. Consider using:
or using GitHub environments for different deployment targets.