- Starting up the server:
- Go to the
docker/dev
directory - If you're doing initialization, execute first:
docker-compose run --entrypoint "/bin/sh -c 'python manage.py migrate && python manage.py createsuperuser'" django
- Then this (for testing purposes):
docker-compose run --entrypoint "python manage.py loaddata fixtures/barcino.json" django
- Run it in isolated Docker environment using:
docker-compose up
(add-d
parameter if you want to run it in the background)
- Go to the
You would need some Debian/Ubuntu distribution for the following:
-
Install Git:
sudo apt-get update sudo apt-get install git
-
Generate SSH Key:
ssh-keygen -t ed25519 -C "[email protected]"
Email must be the one used for your GitHub account.
-
You need to copy the SSH public key that you just generated to your GitHub account. Display the key with the following command, then copy the output:
cat ~/.ssh/id_ed25519.pub
-
In your GitHub account, go to Settings -> SSH and GPG keys -> New SSH Key. Paste the copied public key into the Key field and add a title. Click Add SSH key.
-
Open the SSH configuration file in your favorite text editor:
nano ~/.ssh/config
Add the following lines:
Host github.com IdentityFile ~/.ssh/id_ed25519 IdentitiesOnly yes
Save and close the file.
-
To start the ssh-agent in the background, run:
eval "$(ssh-agent -s)"
-
Then, add your SSH private key to the ssh-agent:
ssh-add ~/.ssh/id_ed25519
Now your host is ready for GitHub Actions. Next, clone this repository:
git clone [email protected]:softzer0/chatbot.git
-
You can proceed to execute
docker/dev/prod/setup.sh
and it will install and setup Nginx with running project in Docker. -
And to finally make GitHub Action from this repository work, go to the settings for the repository, then to Secrets and variables -> Actions, and set these as secrets:
HOST
- IP of your hostUSER
- username which GitHub Action should use when accessing the hostSSH_PRIVATE_KEY
- this needs to contain the content of your SSH private key (~/.ssh/id_ed25519
)
Also, set
TARGET_DIR
in variables which represents the full path on the host to the cloned repository.