Skip to content

Commit e11ccae

Browse files
committed
Add GitHub Actions workflow for build and deploy
1 parent a6b4d5b commit e11ccae

20 files changed

+57
-446
lines changed

.github/workflows/static.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v1
13+
- uses: actions/setup-node@v1 #this installs node and npm for us
14+
with:
15+
node-version: '20.x'
16+
# - uses: actions/cache@v1
17+
# with:
18+
# path: ~/.npm
19+
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20+
# restore-keys: |
21+
# ${{ runner.os }}-node-
22+
- name: Build
23+
run: |
24+
npm install
25+
npm run build
26+
cd ..
27+
pwd
28+
ls -la
29+
- name: Deploy 🚀
30+
uses: JamesIves/github-pages-deploy-action@releases/v4
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
branch: gh-pages
34+
folder: portfolio-page/dist/portfolio-page

angular.json

+6-16
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313
"build": {
1414
"builder": "@angular-devkit/build-angular:application",
1515
"options": {
16-
"outputPath": "portfolio-page",
16+
"outputPath": "dist/portfolio-page",
1717
"index": "src/index.html",
1818
"browser": "src/main.ts",
1919
"polyfills": [
2020
"zone.js"
2121
],
2222
"tsConfig": "tsconfig.app.json",
2323
"assets": [
24-
{
25-
"glob": "**/*",
26-
"input": "public"
27-
}
24+
"src/favicon.ico",
25+
"src/assets"
2826
],
2927
"styles": [
3028
"src/styles.css"
@@ -45,13 +43,7 @@
4543
"maximumError": "4kB"
4644
}
4745
],
48-
"outputHashing": "all",
49-
"fileReplacements": [
50-
{
51-
"replace": "src/environments/environment.ts",
52-
"with": "src/environments/environment.prod.ts"
53-
}
54-
]
46+
"outputHashing": "all"
5547
},
5648
"development": {
5749
"optimization": false,
@@ -85,10 +77,8 @@
8577
],
8678
"tsConfig": "tsconfig.spec.json",
8779
"assets": [
88-
{
89-
"glob": "**/*",
90-
"input": "public"
91-
}
80+
"src/favicon.ico",
81+
"src/assets"
9282
],
9383
"styles": [
9484
"src/styles.css"

index.html

-11
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "portfoliopage",
2+
"name": "portfolio-page",
33
"version": "0.0.0",
44
"scripts": {
55
"ng": "ng",

0 commit comments

Comments
 (0)