How to deploy Ionic 4 app to Github pages?

后端 未结 3 1478
逝去的感伤
逝去的感伤 2021-01-03 15:46

I have a problem deploying Ionic 4 app to Github pages. I tried follwing a tutorial for uploading Angular app but it does not work. It keeps throwing errors of all kinds. Do

3条回答
  •  爱一瞬间的悲伤
    2021-01-03 16:22

    Just a note: For a gitlab repository (not Github) you can do this:

    .gitlab-ci.yml:

    pages:
     image: node:latest
     stage: deploy
     script:
      - npm install -g ionic cordova
      - npm install
      # frontend application is served at https://what-digital.gitlab.io/stemba/
      # we need to set the basePath to the sub dir
      - ionic build --prod -- --base-href="https://what-digital.gitlab.io/gitlab-pages/"
      - rm -rf public
      - mkdir public
      - cp -r www/* public
     artifacts:
      expire_in: 1 week
      paths:
      - public
     only:
      - dev
    
    

提交回复
热议问题