ci: switch over to using forgejo actions
This commit is contained in:
parent
b3d2b83fed
commit
0bea8edc50
11 changed files with 59 additions and 55 deletions
34
.forgejo/workflows/push.yaml
Normal file
34
.forgejo/workflows/push.yaml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
name: On_Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
# paths:
|
||||||
|
# - .forgejo/**/*
|
||||||
|
# - Committee/**/Handovers/*
|
||||||
|
# - Minutes/**/*
|
||||||
|
# - Committee/**/Budget/*
|
||||||
|
# - Events/**/*
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# rust code must be formatted for standardisation
|
||||||
|
pdfs:
|
||||||
|
# build it using teh base nixos system, helps with caching
|
||||||
|
runs-on: nix
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
script: [ handovers, minutes, budget, events ]
|
||||||
|
steps:
|
||||||
|
# get the repo first
|
||||||
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
# actual script to run the build process
|
||||||
|
- run: nix run .#${{ matrix.script }}
|
||||||
|
- run: ls -lah
|
||||||
|
- run: ls -lah pdf_${{ matrix.script }}/
|
||||||
|
# upload the files
|
||||||
|
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: PDFs-${{ matrix.script }}
|
||||||
|
path: pdf_${{ matrix.script }}/
|
|
@ -1,37 +0,0 @@
|
||||||
stages:
|
|
||||||
- build
|
|
||||||
|
|
||||||
pdf:
|
|
||||||
tags:
|
|
||||||
- nix
|
|
||||||
before_script:
|
|
||||||
# basic stuff
|
|
||||||
- nix --extra-experimental-features 'nix-command flakes' profile install nixpkgs#bash
|
|
||||||
|
|
||||||
# setup the cache stuff
|
|
||||||
- nix --extra-experimental-features 'nix-command flakes' profile install nixpkgs#attic-client
|
|
||||||
- attic login skynet https://nix-cache.skynet.ie/ $CACHE_KEY
|
|
||||||
- attic use skynet-cache
|
|
||||||
stage: build
|
|
||||||
# what it runs
|
|
||||||
script:
|
|
||||||
- attic watch-store skynet-cache &
|
|
||||||
- nix --extra-experimental-features 'nix-command flakes' run .#handovers
|
|
||||||
- nix --extra-experimental-features 'nix-command flakes' run .#minutes
|
|
||||||
- nix --extra-experimental-features 'nix-command flakes' run .#budget
|
|
||||||
- nix --extra-experimental-features 'nix-command flakes' run .#events
|
|
||||||
artifacts:
|
|
||||||
name: "PDFs"
|
|
||||||
paths:
|
|
||||||
- pdf_Handovers/
|
|
||||||
- pdf_Minutes/
|
|
||||||
- pdf_Budget/
|
|
||||||
- pdf_Events/
|
|
||||||
- errors.log
|
|
||||||
rules:
|
|
||||||
- if: '$CI_PROJECT_NAMESPACE == "compsoc1/compsoc" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
||||||
changes:
|
|
||||||
- Committee/**/Handovers/*
|
|
||||||
- Minutes/**/*
|
|
||||||
- Committee/**/Budget/*
|
|
||||||
- Events/**/*
|
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
root="$PWD"
|
root="$PWD"
|
||||||
|
|
||||||
folder="budget"
|
folder="Budget"
|
||||||
folder_html="html_${folder}"
|
folder_lower="budget"
|
||||||
folder_pdf="pdf_${folder}"
|
folder_html="html_${folder_lower}"
|
||||||
|
folder_pdf="pdf_${folder_lower}"
|
||||||
|
|
||||||
function build_html() {
|
function build_html() {
|
||||||
# used to match **
|
# used to match **
|
||||||
|
@ -48,6 +49,9 @@ function build_html() {
|
||||||
# make the final folder
|
# make the final folder
|
||||||
mkdir -p "$root/$folder_html/$year_string"
|
mkdir -p "$root/$folder_html/$year_string"
|
||||||
|
|
||||||
|
echo "AAAAAAAAA"
|
||||||
|
ls -lah
|
||||||
|
echo "BBBBBBBBB"
|
||||||
# copy everything to teh final folder
|
# copy everything to teh final folder
|
||||||
cp -R ./$folder_html/* "$root/$folder_html/$year_string"
|
cp -R ./$folder_html/* "$root/$folder_html/$year_string"
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
root="$PWD"
|
root="$PWD"
|
||||||
|
|
||||||
folder="events"
|
folder="Events"
|
||||||
folder_html="html_${folder}"
|
folder_lower="events"
|
||||||
folder_pdf="pdf_${folder}"
|
folder_html="html_${folder_lower}"
|
||||||
|
folder_pdf="pdf_${folder_lower}"
|
||||||
|
|
||||||
function build_html() {
|
function build_html() {
|
||||||
# used to match **
|
# used to match **
|
||||||
|
@ -44,10 +45,10 @@ function build_html() {
|
||||||
mkdir -p "$root/$folder_html/$year_string"
|
mkdir -p "$root/$folder_html/$year_string"
|
||||||
|
|
||||||
# copy everything to teh final folder
|
# copy everything to teh final folder
|
||||||
cp -R ./${folder}_html/* "$root/$folder_html/$year_string"
|
cp -R ./${folder_lower}_html/* "$root/$folder_html/$year_string"
|
||||||
|
|
||||||
# remove teh temp folder
|
# remove teh temp folder
|
||||||
rm -rf "./${folder}_html"
|
rm -rf "./${folder_lower}_html"
|
||||||
|
|
||||||
# return to root
|
# return to root
|
||||||
cd "$root_html"
|
cd "$root_html"
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
root="$PWD"
|
root="$PWD"
|
||||||
|
|
||||||
folder="handovers"
|
folder="Handovers"
|
||||||
folder_html="html_${folder}"
|
folder_lower="handovers"
|
||||||
folder_pdf="pdf_${folder}"
|
folder_html="html_${folder_lower}"
|
||||||
|
folder_pdf="pdf_${folder_lower}"
|
||||||
|
|
||||||
function build_html() {
|
function build_html() {
|
||||||
# used to match **
|
# used to match **
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
root="$PWD"
|
root="$PWD"
|
||||||
|
|
||||||
folder_html="html_minutes"
|
folder_html="html_minutes"
|
||||||
folder_pdf="pdf_Minutes"
|
folder_pdf="pdf_minutes"
|
||||||
|
|
||||||
# make teh html files first
|
# make teh html files first
|
||||||
function build_html() {
|
function build_html() {
|
||||||
|
@ -44,9 +44,10 @@ function build_html() {
|
||||||
mkdir -p "../../$folder_html/$year/Council"
|
mkdir -p "../../$folder_html/$year/Council"
|
||||||
|
|
||||||
# iterate the files
|
# iterate the files
|
||||||
for file in {Committee,Council}_html/*.html; do
|
for file in {committee,council}_html/*.html; do
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
stripped=''${file/_html/""}
|
stripped=''${file/_html/""}
|
||||||
|
echo $stripped
|
||||||
cp $file "../../$folder_html/$year/$stripped"
|
cp $file "../../$folder_html/$year/$stripped"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -9,7 +9,7 @@ indentation = 2
|
||||||
src = "./Budget"
|
src = "./Budget"
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
dest= "./html_Budget"
|
dest= "./html_budget"
|
||||||
|
|
||||||
# html blocks you dont want to include in teh finished page
|
# html blocks you dont want to include in teh finished page
|
||||||
# Optional
|
# Optional
|
||||||
|
|
|
@ -9,7 +9,7 @@ indentation = 2
|
||||||
src = "./AAAAAAA"
|
src = "./AAAAAAA"
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
dest= "./Events_html"
|
dest= "./events_html"
|
||||||
|
|
||||||
# html blocks you dont want to include in teh finished page
|
# html blocks you dont want to include in teh finished page
|
||||||
# Optional
|
# Optional
|
||||||
|
|
|
@ -9,7 +9,7 @@ indentation = 2
|
||||||
src = "./Handovers"
|
src = "./Handovers"
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
dest= "./html_Handovers"
|
dest= "./html_handovers"
|
||||||
|
|
||||||
# html blocks you dont want to include in teh finished page
|
# html blocks you dont want to include in teh finished page
|
||||||
# Optional
|
# Optional
|
||||||
|
|
|
@ -9,7 +9,7 @@ indentation = 2
|
||||||
src = "./Committee"
|
src = "./Committee"
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
dest= "./Committee_html"
|
dest= "./committee_html"
|
||||||
|
|
||||||
# html blocks you dont want to include in teh finished page
|
# html blocks you dont want to include in teh finished page
|
||||||
# Optional
|
# Optional
|
||||||
|
|
|
@ -9,7 +9,7 @@ indentation = 2
|
||||||
src = "./Council"
|
src = "./Council"
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
dest= "./Council_html"
|
dest= "./council_html"
|
||||||
|
|
||||||
# html blocks you dont want to include in teh finished page
|
# html blocks you dont want to include in teh finished page
|
||||||
# Optional
|
# Optional
|
||||||
|
|
Loading…
Reference in a new issue