Skip to content

Commit

Permalink
fix ghpaged deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Arithmomaniac committed Feb 11, 2025
1 parent 803d4e5 commit b6a2d24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: NodeJS with Webpack
name: Build and Deploy

on:
push:
Expand All @@ -9,20 +9,21 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Use Latest Node.js
uses: actions/setup-node@v4
with:
node-version: "node"

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies and Build
run: |
npm install
npx webpack
- name: Build
run: |
npm install
npx webpack
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder where the build output is located.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ node_modules/
# build output
build/
dist/
index.html
plugin.js

# TypeScript cache
*.tsbuildinfo
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
entry: './plugin.tsx',
output: {
filename: 'plugin.js',
path: path.resolve(__dirname)
path: path.resolve(__dirname, 'dist')
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
Expand All @@ -21,9 +21,10 @@ module.exports = {
},
plugins: [
new HtmlWebpackPlugin({
template: './index_template.html', // uses index.html as the template
template: './index.html',
filename: 'index.html', // outputs to dist/index.html
inject: 'head'
})
],
mode: 'development' // Switch to 'production' for production builds
mode: 'development'
};

0 comments on commit b6a2d24

Please sign in to comment.