Add a test to verify collectstatic works before deploying (#346) #96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Deploy Project | |
on: | |
push: | |
branches: | |
- main | |
# release: | |
# types: [released] | |
concurrency: | |
group: deployment | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
name: Deploy project | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
- name: Connect to Tailscale | |
uses: tailscale/github-action@v1 | |
with: | |
authkey: ${{secrets.TAILSCALE_AUTHKEY}} | |
- name: Execute deployment playbook | |
uses: dawidd6/action-ansible-playbook@v2 | |
with: | |
directory: ./.ansible/ | |
playbook: deploy.yml | |
requirements: requirements.yml | |
vault_password: ${{secrets.ANSIBLE_VAULT_PASSWORD}} | |
inventory: | | |
[all:vars] | |
ansible_user=${{secrets.ANSIBLE_SSH_USER}} | |
[all] | |
${{secrets.ANSIBLE_SSH_HOST}} | |
key: ${{secrets.ANSIBLE_SSH_PRIVATE_KEY}} | |
known_hosts: ${{secrets.ANSIBLE_SSH_KNOWN_HOSTS}} | |
env: | |
DEPLOY_SSH_PRIVATE_KEY: ${{secrets.DEPLOY_SSH_PRIVATE_KEY}} | |
WEB_DOMAIN: ${{secrets.WEB_DOMAIN}} | |
EMAIL_ADDRESS: ${{secrets.EMAIL_ADDRESS}} # certbot email | |
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
AWS_STORAGE_BUCKET_NAME: ${{secrets.AWS_STORAGE_BUCKET_NAME}} | |
AWS_S3_CUSTOM_DOMAIN: ${{secrets.AWS_S3_CUSTOM_DOMAIN}} | |
# Django email settings (vars) | |
ADMIN_EMAIL: ${{vars.ADMIN_EMAIL}} | |
SERVER_EMAIL: ${{vars.SERVER_EMAIL}} | |
DEFAULT_FROM_EMAIL: ${{vars.DEFAULT_FROM_EMAIL}} | |
EMAIL_SUBJECT_PREFIX: ${{vars.EMAIL_SUBJECT_PREFIX}} | |
# Django email settings (secrets) | |
EMAIL_HOST: ${{secrets.EMAIL_HOST}} | |
EMAIL_HOST_PASSWORD: ${{secrets.EMAIL_HOST_PASSWORD}} | |
EMAIL_HOST_USER: ${{secrets.EMAIL_HOST_USER}} | |
EMAIL_PORT: ${{secrets.EMAIL_PORT}} | |
EMAIL_USE_TLS: ${{secrets.EMAIL_USE_TLS}} | |
... |