Deploy ParkourLabs.com<!-- --> | <!-- -->IORoot
logo
IORoot
GitHub Actions
githubactions

Deploy ParkourLabs.com

Deploy ParkourLabs onto Production Server through Github Action.

1. Table of Contents

2. About The Project

This is a deployment workflow that allows me to fully push a WordPress site (including the database) into version control and then deploy the site to the production server.

(back to top)

2.1. Built With

This project was built with the following frameworks, technologies and software.

(back to top)

2.2. Installation

Fork repo.

Note, all secrets and database are git-crypted. The real wp-config.php file is already on the server and is symlinked during the process.

(back to top)

3. Usage

3.1. Deploying Process

3.1.1. Deployment to Staging Server

To deploy onto the staging server you can push to the master git branch. This will trigger the necessary steps to fully build the site from the code in this repository.

Use "-nodeploy" in the commit message to not run a deploy and just commit to repo.

3.1.2. Updating this repository with the vagrant version

If you wish to update this repository with the copy on vagrant, use the command;

gitdeploy

This is a bash script in the script-library repository (https://github.com/IORoot/script-library/tree/master/deploy) that will do the following steps:

  1. SSH into the specified vagrant machine (default dev.londonparkour.com) and run dumpdb in the vhost directory.
  2. Move the dump file into this repo's /wp-content/database/ folder so you have a copy of the latest vagrant DB.
  3. Recursively update all git submodules in this repo to get all latest copies of themes and plugins.
  4. Git add all.
  5. Git commit to master unless otherwise specified.
  6. Git push to github.

The gitdeploy command also takes a single argument to push to another branch.

3.1.3. Deployment to LIVE

To deploy to the live server, you need to first add a release to this repository.

github > Releases > Draft a new Release

Then manually run the action.

github > Actions > [LIVE] Create a release > Run Workflow

4. Customising

None.

5. Troubleshooting

None.

(back to top)

6. Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

7. License

Distributed under the MIT License.

MIT License

Copyright (c) 2022 Andy Pearson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

(back to top)

8. Contact

Author Link: https://github.com/IORoot

(back to top)

9. Changelog

  • v1.0.1 - Fixed GUID issue with the tree shortcode plugin. Also added gitdeploy.sh command.

  • v1.0.0 - Setup repo and initial release of LABS V2.0.0