Exercise 15 : Publish App
Introduction
You will learn to publish your applicatoin to https based servers with this exercerise.
a) student.labranet.jamk.fi
Publish one of your application to JAMK student.labranet.jamk.fi server OR you can use any other https based server.
Help
Watch course materials - Production Build video
b) gitlab.labranet.jamk.fi
Publish one of your application to JAMK gitlab.labranet.jamk.fi server. You should use GitLab CI Pipeline.
Create a new React project with CRA template
Give a following command
1 |
|
Make some modifications to your App.js
Modify your app UI to make it unique.
Modify your package.json
Modify your package.json
to use homepage
attribute (you don't have access JAMK/IT GitLab root).
1 2 3 4 |
|
The .gitlab-ci.yml file
You can use a following .gitlab-ci.yml
file in your project. Basicly this will use JAMK/IT GitLab's CI/CD to build your React project and publish it in GitLab Pages.
Save the file to your project root folder.
Note
You might need to change a few things like a PUBLIC_PATH
and your repository branch name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
Repository
Create a new empty repository to JAMK/IT GitLab.
Push
Look your repository and find a commands to Push an existing folder
. Give/copy-paste a those commands to push your local repository to your JAMK/IT GitLab repository.
CI/CD Jobs
Try to be fast and select CD/CD > Jobs page from your JAMK/IT GitLab repository (and click a blue running button). You should see that runners are working to build your project and publish it to JAMK/IT GitLab Pages.
Pages Settings
Select Settings > Pages from your JAMK/IT repository and you should see a link to your pages.
Show Pages
Copy and paste your pages link to your browser and you should see your React app running.
Update
Make some modifications to your App.js
and push your files to JAMK/IT GitLab. Wait a while and refresh your React app in your web browser and you should see a new version of it.
YES - a new version of your app is deployed automatically now with CI/CD.
Push exercise 15 / Publish App
Test your applications in web browser, take screenshots and commit/push your project and screenshots back to JAMKIT/GitLab. Remember move your exercise/issue ticket from Doing to In Review in Issues Board and write your learning comments to issue comments.
Save screenshots to publish-student folder.