Giter Club home page Giter Club logo

deploy-to-git-branch's Introduction

Deploy application to GIT branch

This project follows the DEV.to #ActionsHackathon21 hackathon.

Use GitHub Actions and Workflows to build and deploy your applications to a branch. So you can just pull this branch to deploy on the production server, without building. You can also use it to deploy to Github Pages, by selecting the destination branch as the Github Pages's branch.

Screenshot

Check the complete workflow here (build-and-deploy-to-branch.yml)

Actions used

(Also actions/setup-node@v2 for setup nodejs, although it's not required)

Configurations

  • You can config the deployment branch postfix, with DEPLOY_BRANCH_POSTFIX variable. So the code on "main" branch will be built and pushed into main-<DEPLOY_BRANCH_POSTFIX> branch
  • You can also configure the branches which you want to run this workflow, with branches key.

Flows

In this repository, I use a sample NextJS to demonstrate. However you can change the workflow a bit to fit your project.

  • Use actions/checkout@v2 to checkout source code from the repository
  • Use actions/setup-node@v2 to setup nodejs
  • Use actions/cache@v2 to cache dependencies (node_modules and .yarn directories)
  • Install dependencies with yarn
  • Run tests
  • Build application
  • Synchronize built files with deployment branch
  • Push build into the deployment branch

deploy-to-git-branch's People

Contributors

martinpham 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.