Git Product home page Git Product logo

angular-to-github-option-three-ci-cd's Introduction

Alt Text

This is just a basic app that only contains relevant files to set up this type of deployment - not much else.

OPTION 3

  • PROs
    • automated deployments CI/CD
    • using a single github repo
  • CONs
    • the code is public when using GitHub free
    • more involving setup, creating an additional branch, adding github actions, GH_TOKEN

Step 1:

  • create a git repo, create a local folder for the repo, init (github commands)

Step 2:

  • create a your Angular (v17) app & push to main branch

Step 3:

  • add the build script command in package.json

"build:prod": "ng build --configuration=production --base-href=/<repoName>/"

Step 4:

  • adjust oututPath in angular.json (dist)

Step 5:

  • setup a personal acces token GH_TOKEN to use later (classic)

Step 6:

  • create a main.yaml file in .github/workflows/main.yaml at root level
  • refer to this project for placement and contents (adjust to match your project)

*using prebuilt github actions by James Ives github-pages-deploy-action

Step 7:

  • create a new branch only for the contents of the dist folder
  • erase everything apart fom the dist folder from that second branch and push the changes (I named my branch 'prod')
  • verify that your 'main' branch contains your entire app, while the second branch only has the contents of the dist folder

Step 8:

  • go back to the 'main' branch and push -> this should trigger the workflow from the main.yaml file

Step 9:

  • setup github pages to use the second branch, the one that has only the contents of the dist folder

angular-to-github-option-three-ci-cd's People

Contributors

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