Compare commits
2 commits
fa2573c318
...
e5c3233d76
Author | SHA1 | Date | |
---|---|---|---|
2005 | e5c3233d76 | ||
2005 | f10cb2caac |
62
.forgejo/workflows/build_deploy_dev copy.yml
Normal file
62
.forgejo/workflows/build_deploy_dev copy.yml
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
name: Build docker images, publish them, deploy to test server
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["dev"]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Restore cached Primes
|
||||||
|
id: maven-cache-restore
|
||||||
|
uses: https://github.com/actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
key: linux-maven
|
||||||
|
path: ~/.m2/repository
|
||||||
|
|
||||||
|
- uses: https://github.com/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: 'learningpulse/server'
|
||||||
|
ref: 'dev'
|
||||||
|
token: '${{ secrets.token }}'
|
||||||
|
|
||||||
|
- name: 'Set up java 22'
|
||||||
|
uses: https://github.com/actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: "22"
|
||||||
|
distribution: "temurin"
|
||||||
|
cache: maven
|
||||||
|
|
||||||
|
- name: Setup maven
|
||||||
|
if: steps.maven-cache.outputs.cache-hit != 'true'
|
||||||
|
uses: https://github.com/stCarolas/setup-maven@v5
|
||||||
|
with:
|
||||||
|
maven-version: 3.9.6
|
||||||
|
|
||||||
|
- name: Goto server
|
||||||
|
run: cd server
|
||||||
|
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn -Dtoken=${{ secrets.token }} clean compile jib:build -e
|
||||||
|
|
||||||
|
- name: Cache local Maven repository
|
||||||
|
uses: https://github.com/actions/cache/save@v4
|
||||||
|
id: maven-cache-save
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: linux-maven
|
||||||
|
restore-keys: |
|
||||||
|
linux-maven
|
||||||
|
|
||||||
|
# TODO trigger pull with docker
|
||||||
|
- name: executing remote ssh commands using ssh key
|
||||||
|
uses: https://github.com/appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.HOST }}
|
||||||
|
username: ${{ secrets.USERNAME }}
|
||||||
|
key: ${{ secrets.KEY }}
|
||||||
|
port: ${{ secrets.PORT }}
|
||||||
|
script: cd services/server && git fetch --all && git reset --hard origin/dev && docker compose pull && docker compose up -d
|
21
.forgejo/workflows/mirror_to_remote.yml
Normal file
21
.forgejo/workflows/mirror_to_remote.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
name: Mirror dev branch to remote
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["dev"]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone bare dev branch
|
||||||
|
run: git clone --bare https://git.4o1x5.dev/${{ github.repository }} -b dev
|
||||||
|
- name: Cd into directory
|
||||||
|
run: cd learningpulse
|
||||||
|
- name: Mirror to github
|
||||||
|
run: git push --mirror https://nezsha:${{ secrets.MIRROR_USER_PASSWORD }}@github.com/nezsha/lp
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716509168,
|
"lastModified": 1725432240,
|
||||||
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
|
"narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
|
"rev": "ad416d066ca1222956472ab7d0555a6946746a80",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Go to root then hydra
|
|
||||||
|
|
||||||
```bash
|
|
||||||
su
|
|
||||||
su - hydra
|
|
||||||
```
|
|
||||||
|
|
||||||
# Create an user
|
|
||||||
|
|
||||||
hydra-create-user <USER> --full-name '<NAME>' \
|
|
||||||
--email-address '<EMAIL>' --password-prompt --role admin
|
|
Reference in a new issue