This commit is contained in:
parent
c42015f73c
commit
f6e22d796f
32
.gitea/workflows/deploy.yaml
Normal file
32
.gitea/workflows/deploy.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
env:
|
||||
MFGAMES_GITEA_TOKEN: ${{ secrets.MFGAMES_GITEA_TOKEN }}
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: nix
|
||||
container:
|
||||
volumes:
|
||||
- "/nix"
|
||||
steps:
|
||||
# Checkout the repository so we can load our flake.
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Break apart downloading all the requirements into a separate step for timing purposes.
|
||||
- run: nix develop --command echo prefetch flake
|
||||
|
||||
# Run the deployment.
|
||||
- run: nix develop --command just setup
|
||||
- run: nix develop --command just build
|
||||
- run: nix develop --command just test
|
||||
- run: nix develop --command just release
|
||||
|
||||
# Clean up old packages because we aren't mounting the host's store.
|
||||
- run: nix-collect-garbage --delete-older-than 15d
|
|
@ -1,56 +0,0 @@
|
|||
skip_clone: true
|
||||
|
||||
pipeline:
|
||||
clone:
|
||||
image: nixpkgs/nix-flakes
|
||||
commands:
|
||||
- git clone https://dmoonfire:$GITEA_TOKEN@src.mfgames.com/$DRONE_REPO.git .
|
||||
- git checkout $DRONE_BRANCH
|
||||
- git reset --hard $DRONE_COMMIT
|
||||
- git pull --tags
|
||||
secrets:
|
||||
- gitea_token
|
||||
when:
|
||||
event: [manual, pull_request, push]
|
||||
|
||||
build:
|
||||
image: nixpkgs/nix-flakes
|
||||
commands:
|
||||
- nix develop --command just build
|
||||
volumes:
|
||||
- woodpecker-nix-store:/nix
|
||||
when:
|
||||
event: [manual, pull_request, push]
|
||||
|
||||
test:
|
||||
image: nixpkgs/nix-flakes
|
||||
commands:
|
||||
- nix develop --command just test
|
||||
volumes:
|
||||
- woodpecker-nix-store:/nix
|
||||
when:
|
||||
event: [manual, pull_request, push]
|
||||
|
||||
publish:
|
||||
image: nixpkgs/nix-flakes
|
||||
commands:
|
||||
- nix develop --command just release-nuget
|
||||
volumes:
|
||||
- woodpecker-nix-store:/nix
|
||||
secrets:
|
||||
- gitea_token
|
||||
when:
|
||||
event: [manual, push]
|
||||
branch: main
|
||||
|
||||
tag:
|
||||
image: nixpkgs/nix-flakes
|
||||
commands:
|
||||
- nix develop --command just release-tag
|
||||
volumes:
|
||||
- woodpecker-nix-store:/nix
|
||||
secrets:
|
||||
- gitea_token
|
||||
when:
|
||||
event: [manual, push]
|
||||
branch: main
|
Loading…
Reference in a new issue