Skip to content

Commit 6bdc937

Browse files
authored
Merge pull request #28 from weaponsforge/feat/weaponsforge-27
feat: deploy demo site to gh pages
2 parents 8c68d3e + 9f94d89 commit 6bdc937

File tree

6 files changed

+71
-52
lines changed

6 files changed

+71
-52
lines changed

.github/workflows/release.yml

+18
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ on:
55
types: [published]
66

77
jobs:
8+
deploy-client:
9+
name: Build and Export Client
10+
if: github.event.release.target_commitish == 'master'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout the repository
14+
uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.event.release.tag_name }}
17+
- name: List files for publish
18+
run: cd public && ls -l -a
19+
- name: Deploy to Github Pages
20+
uses: peaceiris/actions-gh-pages@v3
21+
with:
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
publish_dir: public
24+
publish_branch: gh-pages
25+
826
docker-build-push-tag:
927
name: Push Tagged Image
1028
if: github.event.release.target_commitish == 'master' && vars.DOCKERHUB_USERNAME != ''

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Simple localhost static website development environment for plain HTML, CSS, and
55
Its development static hosting and file-serving architecture are closer to traditional static web servers. Uses **Gulp** and **Browser-Sync**
66

77
> [!NOTE]
8-
> An alternate localhost static development environment, also with live reload using Webpack is available at<br>
8+
> An alternate localhost static development environment using **Webpack**, also with live reload, is available at<br>
99
> https://github.com/weaponsforge/livereload-webpack
1010
1111
### Content
@@ -92,14 +92,15 @@ https://hub.docker.com/r/weaponsforge/livereload-basic
9292

9393
2. Run the development image.
9494
- Using only Docker (1st option):
95-
> **INFO:** This option requires having the static website development HTML, CSS and JavaScript files inside a "/public" directory, consisting of at least:
95+
> **INFO:** This option requires having the static website development HTML, CSS and JavaScript files inside a `"/public"` directory, consisting of at least:
9696

9797
```
9898
├─ my-website-project
9999
│ ├─ public
100100
│ ├─── index.html
101101
│ ├─── ...
102102
```
103+
Navigate to the website project directory (for example, `"my-website-project"`) using a terminal, then run:
103104

104105
```
105106
# On Linux OS

gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const watch = function () {
1818
const css = `${root}/**/*.css`
1919
const js = `${root}/**/*.js`
2020

21-
// Use gulp internal and polling if working in Windows WSL2 to enable hot reload
21+
// Use gulp interval and polling if working in Windows WSL2 to enable hot reload
2222
gulp.watch(html,
2323
(process.env.USE_POLLING && { interval: 1000, usePolling: true })
2424
).on('change', browserSync.reload)

public/index.html

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Live Reload Demo</title>
7-
<link href="main.css" rel="stylesheet" type="text/css">
8-
<script src="main.js" type="text/javascript"></script>
9-
</head>
10-
<body onload="init()">
11-
<main>
12-
<h1>It Works!</h1>
13-
<button onclick="clickme()">Click Me</button>
14-
<div class="imgcontainer">
15-
<img src="images/cute-doggo.png">
16-
</div>
17-
</main>
18-
</body>
19-
</html>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Live Reload Demo</title>
7+
<link href="main.css" rel="stylesheet" type="text/css">
8+
<script src="main.js" type="text/javascript"></script>
9+
</head>
10+
<body onload="init()">
11+
<main>
12+
<h1>It Works!</h1>
13+
<button onclick="clickme()">Click Me</button>
14+
<div class="imgcontainer">
15+
<img src="images/cute-doggo.png">
16+
</div>
17+
</main>
18+
</body>
19+
</html>

public/main.css

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
body, html {
2-
margin: 0;
3-
padding: 0;
4-
font-family: Arial, Helvetica, sans-serif;
5-
background-image: url('images/landscape.jpg');
6-
}
7-
8-
.imgcontainer {
9-
margin-top: 48px;
10-
}
11-
12-
img {
13-
width: 300px;
14-
height: 300px;
15-
}
16-
17-
main {
18-
width: 400px;
19-
margin: auto;
20-
display: flex;
21-
flex-direction: column;
22-
align-items: center;
23-
}
1+
body, html {
2+
margin: 0;
3+
padding: 0;
4+
font-family: Arial, Helvetica, sans-serif;
5+
background-image: url('images/landscape.jpg');
6+
}
7+
8+
.imgcontainer {
9+
margin-top: 48px;
10+
}
11+
12+
img {
13+
width: 300px;
14+
height: 300px;
15+
}
16+
17+
main {
18+
width: 400px;
19+
margin: auto;
20+
display: flex;
21+
flex-direction: column;
22+
align-items: center;
23+
}

public/main.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
function init () {
2-
console.log('loaded!!')
3-
}
4-
5-
function clickme () {
6-
alert('i was clicked!')
7-
}
1+
function init () {
2+
console.log('loaded!!')
3+
}
4+
5+
function clickme () {
6+
alert('i was clicked!')
7+
}

0 commit comments

Comments
 (0)