Merge branch 'main' into test

This commit is contained in:
MajorDroolz
2022-12-20 04:12:06 -05:00
3 changed files with 42 additions and 32 deletions

View File

@@ -1,30 +0,0 @@
# A Github Action that minifies html/css/js and pushes it to a new branch
name: minify
on:
push:
branches:
- 'main'
jobs:
minify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Install CLI tools
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm i -g terser csso-cli html-minifier
# Use CLI tools to minify, overwriting existing files
- run: for i in `find . -name "*.js" -type f`; do terser $i --compress -o $i; done
- run: for i in `find . -name "*.css" -type f`; do csso $i -o $i; done
- run: for i in `find . -name "*.html" -type f`; do html-minifier --remove-comments --collapse-whitespace $i -o $i; done
# Push changes to `build` branch
- run: git config user.name ${{ github.actor }}
- run: git config user.email ${{ github.actor }}@user.noreply.github.com
- run: git commit -am 'Automated minify of ${{ github.sha }}'
- run: git push --force -u origin main:build

40
.github/workflows/prepare.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Prepare changes for deployment.
on:
push:
branches:
- 'main'
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.SECRET }}
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies.
run: npm i -g terser csso-cli html-minifier
- name: "Copying changes over to build."
run: git checkout -b build
- name: Minify files.
run: |
for i in `find . -name "*.js" -type f`; do terser $i --compress -o $i; done
for i in `find . -name "*.css" -type f`; do csso $i -o $i; done
for i in `find . -name "*.html" -type f`; do html-minifier --remove-comments --collapse-whitespace $i -o $i; done
- name: "Commiting changes."
run: |
git config user.email "noreply@github.com"
git config user.name "github-actions"
git commit -am "Preparing changes for deployment."
- name: "Pushing changes."
run: git push -f --set-upstream origin build

View File

@@ -151,11 +151,11 @@
<ul class="classes-list">
<li>Foundations of Computer Science</li>
<li>Rensselaer Center for Open Source</li>
<li>Physics I</li>
<li>Calculus I</li>
<li>Calculus II</li>
<li>Introduction to Logic</li>
<li>Language and Power</li>
<li>Calculus I</li>
<li>Physics I</li>
<li>Data Structures</li>
</ul>
</section>