Skip to content

Commit

Permalink
Add GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
Zergus committed Oct 20, 2023
1 parent e1cf933 commit fd7e9d9
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 87 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Deploy to GitHub Pages

on:
push:
branches:
- main # Replace with your default branch if not "main"

jobs:
# Build job
build:
- name: Checkout
uses: actions/checkout@v2

- name: Build
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
build
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/yamllint.json": "file:///Users/smelnyk/Projects/zergus.github.io/.github/workflows/deploy.yml"
}
}
2 changes: 0 additions & 2 deletions bundle.js

This file was deleted.

51 changes: 0 additions & 51 deletions bundle.js.LICENSE.txt

This file was deleted.

26 changes: 0 additions & 26 deletions index.html

This file was deleted.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,5 @@
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"description": "",
"husky": {
"hooks": {
"pre-commit": "yarn build && git add ."
}
}
"description": ""
}
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require("path");
module.exports = {
entry: "./src/index.tsx",
output: {
path: path.resolve(__dirname, "./"), // Output to root directory
path: path.resolve(__dirname, "./build"), // Output to root directory
filename: "bundle.js",
},
module: {
Expand All @@ -26,7 +26,7 @@ module.exports = {
plugins: [
new HtmlWebpackPlugin({
template: "./src/index.html",
filename: "index.html", // Output to root directory
filename: "./index.html",
}),
],
devServer: {
Expand Down

0 comments on commit fd7e9d9

Please sign in to comment.