General
Installation
Configure Scheduled Updates
List of Projects
Supported Static Site Generators
Fornax
Common Erros
Web Components
Style
nfdi-navbar
nfdi-footer
nfdi-body
nfdi-sidebar-element
nfdi-sidebar-eleneo
nfdi-header
nfdi-toc
nfdi-code
Development
last updated at 2022-06-27
To make maintanence of multiple websites easier, you can configure scheduled updates with GitHub actions.
Setup
Add update-dependencies.yml
(or any other name) file to .github/workflows
in your root folder.
name: update-dependencies
# Controls when the workflow will run
on:
# Triggers the workflow at 21pm (depends on timezone) on thursday, once a week.
schedule:
- cron: '0 21 * * THU'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "update_dependencies"
update_dependencies:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
# Setup dotnet environment
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
# Setup dotnet environment
- name: Setup .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.102
# Install node + npm
- name: Setup Node.js environment
uses: actions/setup-node@v3.4.0
with:
node-version: 16
# Install rollup for bundling (needs setup described in "installation")
- name: Install rollup
run: npm install --global rollup@3.1.0
# Update @nfdi4plants/web-components
- name: Update to latest nfdi4plants web components
run: npm install @nfdi4plants/web-components@latest
# Bundle web components with rollup
- name: Bundle npm packages
run: rollup --config rollup.config.js --bundleConfigAsCjs
# This Part is Fornax specific and installs paket
- name: Restore dotnet tools
run: dotnet tool restore
# Update Nfdi4Plants.Fornax via Paket
- name: Update to latest Nfdi4Plants.Fornax version
run: dotnet paket update Nfdi4Plants.Fornax
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update @nfdi4plants/web-components & Nfdi4Plants.Fornax ⬆️
This specific example will update @nfdi4plants/web-components
via npm and rollup and Nfdi4Plants.Fornax
via paket. Should you use another GitHub action to deploy for example to gh-pages. You can add the following trigger event to trigger the deploy event after updating:
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
# triggers when "update-dependencies" is completed
workflow_run:
workflows: [ update-dependencies ]
types: [ completed ]
DataPLANT Support
Besides these technical solutions, DataPLANT supports you with community-engaged data stewardship. For further assistance, feel free to reach out via our
helpdesk
or by contacting us
directly
.