Skip to content

Commit

Permalink
ci/cd: add build and check workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
markjoshwel committed Jun 18, 2024
1 parent fe5c47e commit 3f6327a
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cd-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "continuous deployment: surplus Documentation"

on:
workflow_dispatch:
push:
paths:
- "docs/**"
- "mkdocs.yml"
- "src/spow-telegram-bridge/*.py"
- "src/**/*LICENCE*"
- "docs/**/*LICENCE*"
- "docs/**/*LICENSE*"
- "docs/CC0"
- "*LICENCE*"
- "src/surplus-on-wheels/s+ow"
- "src/surplus-on-wheels/install.sh"
- "src/spow-whatsapp-bridge/install.sh"
- "src/spow-telegram-bridge/install.sh"

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: publish surplus Documentation
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- run: nix develop --impure --command hatch run docs:build

- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: surplus
directory: site
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/cd-telegram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "continuous deployment: Telegram Bridge"

on:
workflow_dispatch:
push:
paths:
- "src/spow-telegram-bridge/**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@main

- run: |
cd src/spow-telegram-bridge
nix develop --command poetry build
- uses: actions/upload-artifact@v4
with:
name: "spow-telegram-bridge"
path: src/spow-whatsapp-bridge/dist
retention-days: 14
28 changes: 28 additions & 0 deletions .github/workflows/cd-whatsapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "continuous deployment: WhatsApp Bridge"

on:
workflow_dispatch:
push:
paths:
- "src/spow-whatsapp-bridge/**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@main

- run: |
cd src/spow-whatsapp-bridge
nix build .#termux
- uses: actions/upload-artifact@v4
with:
name: "spow-whatsapp-bridge-android"
path: src/spow-whatsapp-bridge/result
retention-days: 14
22 changes: 22 additions & 0 deletions .github/workflows/ci-spow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "continuous integration: s+ow"

on:
workflow_dispatch:
push:
paths:
- "src/surplus-on-wheels/**"

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@main

- run: |
cd src/spow-whatsapp-bridge
nix develop --command ./check.sh
22 changes: 22 additions & 0 deletions .github/workflows/ci-telegram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "continuous integration: Telegram Bridge"

on:
workflow_dispatch:
push:
paths:
- "src/spow-telegram-bridge/**"

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@main

- run: |
cd src/spow-telegram-bridge
nix develop --command ./check.sh
22 changes: 22 additions & 0 deletions .github/workflows/ci-whatsapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "continuous integration: WhatsApp Bridge"

on:
workflow_dispatch:
push:
paths:
- "src/spow-whatsapp-bridge/**"

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@main

- run: |
cd src/spow-whatsapp-bridge
nix develop --command ./check.sh

0 comments on commit 3f6327a

Please sign in to comment.