This commit is contained in:
77
.gitea/workflows/deploy.yml
Normal file
77
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
name: Deploy Vault
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
env:
|
||||||
|
# URL of the repository to clone
|
||||||
|
TEMPLATE_REPO_URL: https://git.aranroig.com/Syndria98/dnd-vault-template.git
|
||||||
|
# Folder name inside the target repo where this repo's contents will be placed
|
||||||
|
TARGET_SUBFOLDER: template/content
|
||||||
|
VAULT_NAME: test-campaign
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
path: current
|
||||||
|
|
||||||
|
- name: Install SSH client
|
||||||
|
run: |
|
||||||
|
apt-get update -y && apt-get install -y openssh-client
|
||||||
|
|
||||||
|
- name: Setup SSH inside container
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
|
# Add the container host to known_hosts
|
||||||
|
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Log in to registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.aranroig.com -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Clone target repository
|
||||||
|
run: |
|
||||||
|
git clone "$TEMPLATE_REPO_URL" target
|
||||||
|
|
||||||
|
- name: Copy current repo contents into target subfolder
|
||||||
|
run: |
|
||||||
|
rm -R target/$TARGET_SUBFOLDER
|
||||||
|
mkdir -p target/$TARGET_SUBFOLDER
|
||||||
|
# Exclude the .git directory from the copy
|
||||||
|
rsync -av --exclude={.git,.obsidian,.gitea} current/content/ target/$TARGET_SUBFOLDER/
|
||||||
|
|
||||||
|
- name: Build frontend
|
||||||
|
run: |
|
||||||
|
docker build -t git.aranroig.com/${{ secrets.REGISTRY_USER }}/vault-$VAULT_NAME:latest ./target/template
|
||||||
|
docker push git.aranroig.com/${{ secrets.REGISTRY_USER }}/vault-$VAULT_NAME:latest
|
||||||
|
|
||||||
|
- name: Generate docker compose .env
|
||||||
|
run: |
|
||||||
|
cat > ./target/.env << EOF
|
||||||
|
VAULT_NAME=$VAULT_NAME
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Copy files
|
||||||
|
run: |
|
||||||
|
scp ./target/docker-compose.yml deploy@${{ secrets.DEPLOY_HOST}}:/var/www/app/
|
||||||
|
scp ./target/nginx.conf deploy@${{ secrets.DEPLOY_HOST }}:/var/www/app/nginx.conf
|
||||||
|
scp ./target/.env deploy@${{ secrets.DEPLOY_HOST }}:/var/www/app/.env
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
ssh deploy@${{ secrets.DEPLOY_HOST }} << 'EOF'
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.aranroig.com -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
cd /var/www/app/
|
||||||
|
docker-compose pull
|
||||||
|
docker-compose up -d
|
||||||
|
EOF
|
||||||
12
.obsidian/workspace.json
vendored
12
.obsidian/workspace.json
vendored
@@ -13,12 +13,12 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "markdown",
|
"type": "markdown",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Bienvenido.md",
|
"file": "content/Exemple.md",
|
||||||
"mode": "preview",
|
"mode": "preview",
|
||||||
"source": false
|
"source": false
|
||||||
},
|
},
|
||||||
"icon": "lucide-file",
|
"icon": "lucide-file",
|
||||||
"title": "Bienvenido"
|
"title": "Exemple"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -180,11 +180,15 @@
|
|||||||
"daily-notes:Abrir la nota de hoy": false,
|
"daily-notes:Abrir la nota de hoy": false,
|
||||||
"templates:Insertar plantilla": false,
|
"templates:Insertar plantilla": false,
|
||||||
"command-palette:Abrir paleta de comandos": false,
|
"command-palette:Abrir paleta de comandos": false,
|
||||||
"bases:Crear nueva base": false
|
"bases:Crear nueva base": false,
|
||||||
|
"obsidian-git:Open Git source control": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "9f5d2c22ee960ac1",
|
"active": "9f5d2c22ee960ac1",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Bienvenido.md"
|
"content/index.md",
|
||||||
|
"content/Exemple.md",
|
||||||
|
"content/Bienvenido.md",
|
||||||
|
"content"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
Esta es su nueva *bóveda*.
|
|
||||||
|
|
||||||
Cree una nota de algo, [[cree un enlace]], o pruebe [el Importador](https://help.obsidian.md/Plugins/Importer)!
|
|
||||||
|
|
||||||
Cuando esté listo, borre esta nota y aprópiese de la bóveda
|
|
||||||
1
content/Exemple.md
Normal file
1
content/Exemple.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Test example test
|
||||||
3
content/index.md
Normal file
3
content/index.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Index
|
||||||
|
|
||||||
|
Pagina principal. S'hauria de poder anara a [[Exemple]]
|
||||||
Reference in New Issue
Block a user