Compare commits

..

2 commits

Author SHA1 Message Date
dd6bc96691
ci: test splitting it up into several different workflows
Some checks failed
On_Push / pdfs (events) (push) Has been cancelled
On_Push / pdfs (budget) (push) Has been cancelled
On_Push / pdfs (handovers) (push) Has been cancelled
On_Push / pdfs (push) Failing after 0s
2024-09-14 20:15:55 +01:00
dfc5075ce6
fix: revert back to earlier pipeline config 2024-09-14 19:57:38 +01:00
4 changed files with 72 additions and 39 deletions

View file

@ -0,0 +1,42 @@
name: 'Build and Release PDF'
description: 'Build and release the PDFs in teh Open Governance repo'
inputs:
repository:
description: 'Pass in gitea.repository'
required: true
ref_name:
description: 'Pass in gitea.ref_name'
required: true
token:
description: 'Pass in secrets.API_TOKEN_FORGEJO'
required: true
script:
description: 'The script we want to run'
required: true
runs:
using: "composite"
steps:
# get the repo first
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://forgejo.skynet.ie/Skynet/actions/get_lfs@v3
with:
repository: ${{ inputs.repository }}
ref_name: ${{ inputs.ref_name }}
# actual script to run the build process
- run: nix run .#${{ inputs.script }}
# zip the files so they can be released
- run: |
mkdir releases
zip -r releases/${{ inputs.script }}.zip pdf_${{ inputs.script }}
# upload them so they are available at https://forgejo.skynet.ie/Computer_Society/open-goverance/releases/tag/minutes_latest
- uses: https://forgejo.skynet.ie/Skynet/actions-forgejo-release@v1
with:
token: ${{ inputs.token }}
direction: upload
release-dir: releases
url: https://forgejo.skynet.ie
repo: Computer_Society/open-goverance
title: "PDFs of ${{ inputs.script }}"
tag: "${{ inputs.script }}_latest"
# basically replace an existing release if it exists
override: true

View file

@ -7,60 +7,23 @@ on:
paths: paths:
- .forgejo/**/* - .forgejo/**/*
- Committee/**/Handovers/* - Committee/**/Handovers/*
- Minutes/**/*
- Committee/**/Budget/* - Committee/**/Budget/*
- Events/**/* - Events/**/*
# so we can manually build the artifacts # so we can manually build the artifacts
workflow_dispatch: workflow_dispatch:
jobs: jobs:
changes:
runs-on: nix
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
scripts: ${{ steps.filter.outputs.changes }}
steps:
# make sure the code is available
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://forgejo.skynet.ie/Skynet/actions/get_lfs@v3
with:
repository: ${{ gitea.repository }}
ref_name: ${{ gitea.ref_name }}
# For pull requests it's not necessary to checkout the code
- uses: https://github.com/dorny/paths-filter@v3
id: filter
with:
filters: |
minutes:
- 'Minutes/**/*'
events:
- 'Events/**/*'
handovers:
- 'Committee/**/Handovers/*'
budgets:
- 'Committee/**/Budget/*'
# rust code must be formatted for standardisation # rust code must be formatted for standardisation
pdfs: pdfs:
# build it using teh base nixos system, helps with caching # build it using teh base nixos system, helps with caching
runs-on: nix runs-on: nix
needs: changes
strategy: strategy:
matrix: matrix:
# script: [ handovers, minutes, budget, events ] script: [ handovers, budget, events ]
script: ${{ fromJSON(needs.changes.outputs.scripts) }}
permissions: permissions:
# needs this to create tags and releases # needs this to create tags and releases
contents: write contents: write
steps: steps:
- env:
OUTPUT1: ${{needs.changes.outputs.scripts}}
OUTPUT2: ${{ fromJSON(needs.changes.outputs.scripts) }}
run: echo "$OUTPUT1 $OUTPUT2"
# the if statements are to only run if there are changes in the sub dir
# get the repo first # get the repo first
- uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://forgejo.skynet.ie/Skynet/actions/get_lfs@v3 - uses: https://forgejo.skynet.ie/Skynet/actions/get_lfs@v3

View file

@ -0,0 +1,28 @@
name: On_Push
on:
push:
branches:
- 'main'
paths:
- .forgejo/**/*
- Minutes/**/*
# so we can manually build the artifacts
workflow_dispatch:
jobs:
# rust code must be formatted for standardisation
pdfs:
# build it using teh base nixos system, helps with caching
runs-on: nix
permissions:
# needs this to create tags and releases
contents: write
steps:
- name: Use local action
uses: ./.forgejo/actions/build-release-pdf
with:
repository: ${{ gitea.repository }}
ref_name: ${{ gitea.ref_name }}
token: ${{ secrets.API_TOKEN_FORGEJO }}
script: "minutes"