Skip to content

Commit

Permalink
ci: automatic deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuster23 committed Jul 10, 2024
1 parent 3c3aeab commit b276573
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 47 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build

on:
pull_request: {}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.128.2'
extended: true

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: '**/package-lock.json'
run: npm ci

- name: Build
run: hugo --minify
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.128.2'
extended: true

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: '**/package-lock.json'
run: npm ci

- name: Build
run: hugo --minify

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
personal_token: ${{ secrets.RELEASE_TOKEN }}
external_repository: modelix/modelix.github.io
publish_branch: main
publish_dir: ./public


4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

19 changes: 2 additions & 17 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,10 @@ This repository contains the source code for the modelix website. The website is

To be able to edit the website and deploy it you need to have two things installed:

- hugo 0.110 (newer versions will break)
- hugo 0.128.2
- Go (required for the build with hugo)
- NPM for installing the dependencies

### Clone the Repository

This repository uses recursive submodules. In order to clone it run:

```
git clone --recurse-submodules https://github.com/modelix/website.git
```

### Install dependencies

After cloning the sources code run:
Expand All @@ -30,11 +23,3 @@ to install the required CSS tools.
### Edit

Edit the sources with your favorite editor. You can run `hugo server` in the background to get a live preview of your changes in the browser.

### Commit and Deploy

Commit your changes once you are finished.

Do deploy the website run `./deploy.sh` in the root of the repository. This will rebuild the website with hugo and push the changes to the github pages repository.

The github pages repository is included as a submodule to seperate the source code and the generate HTML, therefor please commit once more after you have ran the deploy script.
25 changes: 0 additions & 25 deletions deploy.sh

This file was deleted.

1 change: 0 additions & 1 deletion public
Submodule public deleted from de864b

0 comments on commit b276573

Please sign in to comment.