Compare commits

..

2 commits
1.0.1 ... main

Author SHA1 Message Date
5cacfdb574
chore(tooling): update workflow
All checks were successful
main / publish (push) Has been skipped
main / main (push) Successful in 22s
main / deploy (push) Has been skipped
2025-04-12 14:08:59 +02:00
060942051f
chore(tooling): integrate forgejo workflow's deploy step into the makefile's
All checks were successful
/ deploy (push) Has been skipped
/ publish (push) Has been skipped
/ build (push) Has been skipped
/ test (push) Successful in 17s
2025-04-09 18:20:24 +02:00
2 changed files with 21 additions and 21 deletions

View file

@ -1,10 +1,12 @@
---
name: 'main'
on:
push:
workflow_dispatch:
jobs:
test:
main:
runs-on: 'self-hosted'
steps:
- uses: 'actions/checkout@v4'
@ -17,16 +19,6 @@ jobs:
- name: 'check'
run: |
make check no-dirty
build:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs:
- 'test'
runs-on: 'self-hosted'
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-go@v5'
with:
go-version-file: 'go.mod'
- name: 'build'
run: |
printf '%s' "$GIT_CRYPT_SECRET" | base64 -d > secret
@ -36,13 +28,15 @@ jobs:
GIT_CRYPT_SECRET: '${{ secrets.GIT_CRYPT }}'
#- uses: 'actions/upload-artifact@v4'
- uses: 'forgejo/upload-artifact@v4'
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
with:
if-no-files-found: 'error'
name: 'ods'
path: 'ods'
deploy:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs:
- 'build'
- 'main'
runs-on: 'self-hosted'
steps:
#- uses: 'actions/download-artifact@v4'
@ -50,16 +44,13 @@ jobs:
with:
name: 'ods'
- run: |
umask 077
printf '%s' "$SSH_PRIVATE_KEY" | base64 -d > private_key
SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new"
rsync -e "ssh ${SSHOPTS}" ods ods@ods.adyxax.org:
ssh ${SSHOPTS} ods@ods.adyxax.org "chmod +x ods; systemctl --user restart ods"
make deploy
env:
SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}'
publish:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs:
- 'build'
- 'main'
runs-on: 'self-hosted'
steps:
#- uses: 'actions/download-artifact@v4'
@ -74,4 +65,4 @@ jobs:
release-dir: './'
token: '${{ env.GITHUB_TOKEN }}'
hide-archive-link: true
prerelease: true
prerelease: false

View file

@ -37,8 +37,17 @@ push: tidy no-dirty check ## push changes to git remote
.PHONY: deploy
deploy: build ## deploy changes to the production server
rsync ./ods ods@ods.adyxax.org:
ssh ods@ods.adyxax.org "systemctl --user restart ods"
umask 077
if [ -n "$${SSH_PRIVATE_KEY:-}" ]; then
cleanup() {
rm -f private_key
}
trap cleanup EXIT
printf '%s' "$$SSH_PRIVATE_KEY" | base64 -d > private_key
SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new"
fi
rsync -e "ssh $${SSHOPTS:-}" ./ods ods@ods.adyxax.org:
ssh $${SSHOPTS:-} ods@ods.adyxax.org "chmod +x ods; systemctl --user restart ods"
##### Utils ####################################################################
.PHONY: confirm