Code Monkey home page Code Monkey logo

github-actions-test's Introduction

Github Action Deployment over SSH

This deploys a sample docker container to a remote server using only SSH connections. The deployment action sets up and calls an Ansible playbook that performs the install on the remote SSH server.

The deploy software action uses workflow_dispatch event trigger which can be called manualy from the actions page or called using an API call from other software. The workflow requires two inputs, the hostname and the release version. If this should be run more like a cron job, this could be changed to a schedule event.

The deployment is run on a self hosted Github action runner that would be located within the private network and have access to SSH on the remote server. A SSH connection through a VPN would look the same as a local SSH box locked down.

Diagram showing Action layout

Github Actions

  • deploy-software.yaml - This action deployes the software via an Ansible playbook, this actions runs on a self hosted runner
    • ansible/deploy.yaml - Ansible playbook to perform deployment, the steps include
      • Download tar archive from Github release
      • Copy tar acrhive to remote server
      • Import tar archive into Docker images on remote server
      • Starts docker container on remote server
  • docker-image.yaml - Creates tar archive of Docker image and saves it to Github release when a tag like v1.0.0 is created

Folders

Local Servers

The servers localy include:

  • Self hosted Github runner running Ubuntu Linux, the installed software includes
    • Docker
    • Ansible
  • Test box with docker installed and SSH keys allowing runner to connect and sudo

github-actions-test's People

Contributors

jesswonky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.