Skip to content

Commit

Permalink
add(workflows): github action to deploy hugo website on pages
Browse files Browse the repository at this point in the history
add github workflow to deploy website

fix(workflows) : add prerequisites for docsy

fix(workflows) : add prerequisites for docsy

fix(workflows) : add prerequisites for docsy

fix(workflows) : add prerequisites for docsy

fix(workflows) : add prerequisites for docsy

fix(workflows): push package-lock.json

fix(workflows): push package-lock.json

fix(workflows) : condiiton deploy

fix(workflows) : condition deploy

fix(workflows) : condition deploy

add(content): initial wip release
  • Loading branch information
NicoFgrx committed Oct 2, 2023
1 parent 00f5337 commit c6e5f5f
Show file tree
Hide file tree
Showing 7 changed files with 1,094 additions and 2 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Deploy docs.ctfer.io on Github Pages

on:
push:
branches:
- main # Set a branch to deploy

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3

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

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
# The action defaults to search for the dependency file (package-lock.json,
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
# hash as a part of the cache key.
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
cache-dependency-path: '**/package-lock.json'

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name : Install Node.js dependencies
run: npm ci

- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/*
themes/*
resources/*
package-lock.json
# package-lock.json
.hugo_build.lock

public/*
7 changes: 7 additions & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++

+++

{{< image
src="images/gopher_wip.jpeg"
alt="" >}}
Binary file added content/images/gopher_wip.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ctfer-io/quickstart
module github.com/ctfer-io/website

go 1.20

Expand Down
10 changes: 10 additions & 0 deletions layouts/shortcodes/image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ $src := .Get "src" }}
{{ $alt := .Get "alt" }}

<div align="center">
<img
src="{{ $src }}"
alt="{{ $alt }}"
decoding="async"
/>
</div>
Loading

0 comments on commit c6e5f5f

Please sign in to comment.