Skip to content

Commit

Permalink
add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lilpacy committed Nov 4, 2024
1 parent 3387d78 commit 936dc1d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 7 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy

on:
push:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Build project
run: npm run build

- name: Upload production-ready build files
uses: actions/upload-artifact@v4
with:
name: production-files
path: ./dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
9 changes: 2 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,11 @@ const cubeMaterial = new THREE.ShaderMaterial({
varying vec3 vPosition;
void main() {
vec3 color = vPosition;
if(abs(vPosition.x) == 0.5 || abs(vPosition.y) == 0.5 || abs(vPosition.z) == 0.5) {
gl_FragColor = vec4(color, 0.0);
} else {
gl_FragColor = vec4(color, 0.3);
}
gl_FragColor = vec4(color, 0.3);
}
`,
transparent: true,
side: THREE.DoubleSide,
depthWrite: false
side: THREE.DoubleSide
});

const cube = new THREE.Mesh(cubeGeometry, cubeMaterial);
Expand Down

0 comments on commit 936dc1d

Please sign in to comment.