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: on:
push: push:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
test: main:
runs-on: 'self-hosted' runs-on: 'self-hosted'
steps: steps:
- uses: 'actions/checkout@v4' - uses: 'actions/checkout@v4'
@ -17,16 +19,6 @@ jobs:
- name: 'check' - name: 'check'
run: | run: |
make check no-dirty 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' - name: 'build'
run: | run: |
printf '%s' "$GIT_CRYPT_SECRET" | base64 -d > secret printf '%s' "$GIT_CRYPT_SECRET" | base64 -d > secret
@ -36,13 +28,15 @@ jobs:
GIT_CRYPT_SECRET: '${{ secrets.GIT_CRYPT }}' GIT_CRYPT_SECRET: '${{ secrets.GIT_CRYPT }}'
#- uses: 'actions/upload-artifact@v4' #- uses: 'actions/upload-artifact@v4'
- uses: 'forgejo/upload-artifact@v4' - uses: 'forgejo/upload-artifact@v4'
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
with: with:
if-no-files-found: 'error' if-no-files-found: 'error'
name: 'ods' name: 'ods'
path: 'ods' path: 'ods'
deploy: deploy:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs: needs:
- 'build' - 'main'
runs-on: 'self-hosted' runs-on: 'self-hosted'
steps: steps:
#- uses: 'actions/download-artifact@v4' #- uses: 'actions/download-artifact@v4'
@ -50,16 +44,13 @@ jobs:
with: with:
name: 'ods' name: 'ods'
- run: | - run: |
umask 077 make deploy
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"
env: env:
SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}' SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}'
publish: publish:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs: needs:
- 'build' - 'main'
runs-on: 'self-hosted' runs-on: 'self-hosted'
steps: steps:
#- uses: 'actions/download-artifact@v4' #- uses: 'actions/download-artifact@v4'
@ -74,4 +65,4 @@ jobs:
release-dir: './' release-dir: './'
token: '${{ env.GITHUB_TOKEN }}' token: '${{ env.GITHUB_TOKEN }}'
hide-archive-link: true 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 .PHONY: deploy
deploy: build ## deploy changes to the production server deploy: build ## deploy changes to the production server
rsync ./ods ods@ods.adyxax.org: umask 077
ssh ods@ods.adyxax.org "systemctl --user restart ods" 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 #################################################################### ##### Utils ####################################################################
.PHONY: confirm .PHONY: confirm