Added step to remove unwanted folders #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Hugo Site to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.16.0' | |
- name: Install dependencies | |
run: | | |
npm ci | |
npm -g install js-beautify | |
- name: Cache Hugo | |
id: cache-hugo | |
uses: actions/cache@v3 | |
with: | |
path: ./hugo | |
key: ${{ runner.os }}-hugo-0.129.0-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-hugo-0.129.0- | |
- name: Install Hugo | |
if: steps.cache-hugo.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/gohugoio/hugo/releases/download/v0.129.0/hugo_extended_0.129.0_Linux-64bit.tar.gz | |
tar -xzf hugo_extended_0.129.0_Linux-64bit.tar.gz hugo | |
rm hugo_extended_0.129.0_Linux-64bit.tar.gz | |
- name: Build Hugo site | |
run: ./hugo -d public | |
- name: Create CNAME file | |
run: echo 'bridgebeam.design' > public/CNAME | |
- name: Remove unwanted files | |
run: | | |
find public/de public/en -type d \( -name features -o -name clients -o -name deliverables -o -name plans \) -exec rm -rf {} + | |
- name: Beautify HTML files | |
run: find public/ -type f -name "*.html" -exec js-beautify --html -r -m 1 "{}" \; | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |