Adding files to repository

Trellis and DO have my life much easier. Thanks for the all the hard work. I do have a question though.

I have a working version of my site running on DO but I’m not sure the repository is setup correctly.

When adding my files to the repository I added both the /trellis & /site folder. I read here that you only add the /site folder to git. Although I added both directories it seems to be working just fine.

What is the best practice for adding files into the repository for deployment?

Our official docs cover this: and here’s an example repo

So yes, they should both be included (for the default workflow).

Thats what I thought but wanted to be safe. Thank you

I do have one more question though. When setting up Staging and Production environments on DO should I setup 2 droplets? 1 for staging and 1 for production. This is my first crack at this so sorry if these are silly questions.

Yeah, you should ideally. Production should always be isolated.

Ok good to know.

Another issue I’m having. I setup my droplet with SSH key for staging. I added all my code to repo but when I try to run:

ansible-playbook server.yml -e env=staging

I get

fatal: []: UNREACHABLE! => {"changed": false, "unreachable": true}

On another site that I am using the same process everything works fine. I can ssh into the new droplet with no problems. Any ideas what might be happening here?

I also pinged staging and get the correct ip back for my droplet. Could this be a DNS issue if I just added the A Record

Could you create another thread please if you’re having a separate issue? We don’t like these threads to keep going on with different problems since it makes them hard to follow and provide a solution for which can be easily searchable by other people.

Sure thing I just did. Thanks again for the help.