Skip to content

Commit b94b6a8

Browse files
committed
update 02-github-actions
1 parent 0db1d0c commit b94b6a8

38 files changed

Lines changed: 5035 additions & 2784 deletions

07-cloud/02-github-actions/.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
run: npm run build
3131

3232
- name: Deploy
33-
run: npm run deploy -- -r git@github.com:nasdan/nasdan-to-rm.git
33+
run: npm run deploy -- -r git@github.com:<your-repo>.git

07-cloud/02-github-actions/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ _./package.json_
3838
"scripts": {
3939
"start": "run-p -l type-check:watch start:dev",
4040
"start:dev": "vite --port 8080",
41-
"build": "npm run type-check && npm run clean && npm run build:prod",
42-
"build:prod": "vite build",
41+
"prebuild": "npm run type-check && npm run clean",
42+
"build": "vite build",
43+
+ "prebuild:dev": "npm run prebuild",
4344
+ "build:dev": "vite build --mode development",
4445
+ "deploy": "gh-pages -d dist",
4546
...
@@ -84,7 +85,6 @@ jobs:
8485

8586
- name: Deploy
8687
run: npm run deploy
87-
8888
```
8989
9090
Add commit with changes:
@@ -95,21 +95,26 @@ git commit -m "add continuos deployment"
9595
git push
9696
```
9797

98-
As we saw, the workflow was failed. Why? Because each time a Github job is executed, it's a new and clean machine outside repository. That is, we need to allow job's git push. The best approach is creating a new ssh key on local:
98+
As we saw, the workflow failed. Why? Because each time a Github job is executed, it's a new and clean machine outside repository. That is, we need to allow job's git push. The best approach is creating a new ssh key on local:
9999

100100
```bash
101101
ssh-keygen -m PEM -t rsa -C "cd-user@my-app.com"
102102
```
103+
103104
```bash
104-
> Enter file in which to save the key (/c/Users/nasda/.ssh/id_rsa): `./id_rsa`
105+
> Enter file in which to save the key: `./id_rsa`
105106
> Enter passphrase (empty for no passphrase): `Pulse Enter for empty`
106107
> Enter same passphrase again: `Pulse Enter for empty`
107108
```
108109

109-
> NOTES
110+
> NOTES:
111+
>
110112
> -m PEM: Format to apply. PEM is a common public/private key certificate format.
113+
>
111114
> rsa: RSA is the crypto algorithm.
115+
>
112116
> Enter `./id_rsa` to save files in currect directory
117+
>
113118
> You can leave empty the passphrasse field.
114119
115120
Copy `id_rsa.pub` content to `Github Settings` > `Deploy keys` section:
@@ -171,6 +176,7 @@ jobs:
171176
```
172177

173178
> NOTES:
179+
>
174180
> "Use SSH key" step: create id_rsa with ssh private key in default ssh folder and add write permits.
175181
>
176182
> "Deploy" step: update deploy command with repository's SSH URL.

0 commit comments

Comments
 (0)