Setup Forgejo #126
3 changed files with 82 additions and 0 deletions
53
.forgejo/workflows/deploy.yaml
Normal file
53
.forgejo/workflows/deploy.yaml
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
name: Build_Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [ "Update_Flake" ]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- applications/**/*
|
||||||
|
- machines/**/*
|
||||||
|
- secrets/**/*
|
||||||
|
- flake.*
|
||||||
|
- config/**/*
|
||||||
|
- .forgejo/**/*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linter:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: nix fmt -- --check .
|
||||||
|
|
||||||
|
#if: github.repository == 'Skynet/nixos'
|
||||||
|
build:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: nix develop
|
||||||
|
- run: colmena build -v --on @active-dns
|
||||||
|
- run: colmena build -v --on @active-core
|
||||||
|
- run: colmena build -v --on @active
|
||||||
|
- run: colmena build -v --on @active-ext
|
||||||
|
- run: colmena build -v --on @active-gitlab
|
||||||
|
|
||||||
|
deploy_dns:
|
||||||
|
runs-on: nix
|
||||||
|
needs: [ linter, build ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: colmena apply -v --on @active-dns --show-trace
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
deploy_active:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
batch: [ active-core, active, active-ext ]
|
||||||
|
runs-on: nix
|
||||||
|
needs: [ deploy_dns ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: colmena apply -v --on @${{ matrix.batch }} --show-trace
|
||||||
|
shell: bash
|
29
.forgejo/workflows/update_input.yaml
Normal file
29
.forgejo/workflows/update_input.yaml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
name: Update_Flake
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
input_to_update:
|
||||||
|
description: 'Flake input to update'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: nix
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
# Give the default GITHUB_TOKEN write permission to commit and push the
|
||||||
|
# added or changed files to the repository.
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
token: ${{ secrets.PIPELINE_TOKEN }}
|
||||||
|
- run: nix flake lock --update-input "${{ inputs.input_to_update }}"
|
||||||
|
shell: bash
|
||||||
|
- uses: https://github.com/stefanzweifel/git-auto-commit-action@v5
|
||||||
|
with:
|
||||||
|
commit_message: "Updated flake for ${{ inputs.input_to_update }}"
|
Loading…
Reference in a new issue