Skip to content
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

Add Ansible CD using github action to deploy project on staging vm #1123

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
add google storage json to cd
  • Loading branch information
iknowright committed Jul 11, 2023
commit fd20849c39dcc08fbe1f6b7ebd450fc4ff249cae
3 changes: 3 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
- name: Generate .env for staging vm from github secrets
run: |
echo "${{secrets.PRODUCTION_DOT_ENV_FILE}}" > .env
- name: Generate google-cloud-storage.json to src from secrets
run: |
echo "${{secrets.PRODUCTION_GOOGLE_CLOUD_STORAGE_JSON}}" > src/google-cloud-storage.json
- name: Decode private key file for OpenSSH access over Ansible
run: |
echo "${{secrets.SSH_PRIVATE_KEY}}" | base64 --decode > "private.pem"
Expand Down
1 change: 1 addition & 0 deletions document/continuous_deployment.md
Copy link
Collaborator

@josix josix Mar 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Overall the document looks great to me. Thanks @iknowright!
Here are some suggestions. If you think they would be beneficial, please feel free to adopt them.

  • Provide more context in the introduction. What is continuous deployment, and why is it important? How does it relate to the docker production deployment document mentioned?
  • In the "Settings for Github Actions Workflow" section, consider adding a brief overview of what Github Actions and Ansible are, and how they are used for continuous deployment.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ So kindly configure project's action setting as the following:
| Level | Type | Name | Value (example) | Remarks |
|-----------|------------|---------------|----------|------------|
| Repository | secrets | PRODUCTION_DOT_ENV_FILE | `DATABASE_URL=...` | multiline support |
| Repository | secrets | PRODUCTION_GOOGLE_CLOUD_STORAGE_JSON | `{ ...` | multiline support |
| Repository | secrets | VM_USERNAME | cd_user | user name for ssh {user_name}@{vm_domain} |
| Repository | secrets | VM_DOMAIN_IP | staging.pycon.tw | IP address or Domain that points to the staging server |
| Repository | secrets | VM_PYTHON_INTERPRETER | `/home/dev/.pyenv/shims/python` | path to your python environment that has docker/docker-compose packages installed |
Expand Down