forked from kovagoadi.hu/static.kovagoadi.hu
Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 56a8e1675a | |||
| f97d179cfb | |||
| 217fae3f6e | |||
| ddb4c30d7c | |||
| cff6a4d7d6 | |||
| f3c2511291 | |||
| 04fa718a7c | |||
| 757d0f6f68 | |||
| c0fd42b089 | |||
| 29678e4171 | |||
| d5939a2184 | |||
| 901d4f5474 | |||
| 988d559a7f | |||
| 26cec94393 | |||
| 0e5df25eaa | |||
| 1da515163c | |||
| c032ae55fe | |||
| 0e4ebab525 | |||
| 0f9245b6b2 | |||
| e88dbe739d | |||
| ed4954e7fc | |||
| 9fae826205 | |||
| 8ef49c55a6 | |||
| 126faeec80 | |||
| bc2b94db6a | |||
| cc42437e7f | |||
| de2ecaf839 | |||
| afc44ec968 | |||
| baad5111d3 | |||
| f62fa3608d | |||
| 1fe1bf1b6e | |||
| 7de176aa1a | |||
| 6c89dcc3c2 | |||
| 1fc9d0b8c9 | |||
| ca90e94671 | |||
| f19f9ba116 | |||
| 559df7506c | |||
| 6449fb2d67 | |||
| d93138349b | |||
| a06625b818 | |||
| b2cb20b4a0 | |||
| 28e437469a | |||
| df97385a82 | |||
|
|
e277c79fb3 | ||
|
|
5df36a724e | ||
| 553b5ee2b6 | |||
| 9ce291351f | |||
| 77c7738a08 | |||
| 9aea346b02 | |||
| 64fec3f4dc | |||
| 2f23b1bd75 | |||
| ed3cd9867b | |||
| db60419881 | |||
| 3f48bd817c | |||
| 58ad0d389a | |||
| 6a0f600276 | |||
| 716f9aa535 | |||
| 6cb8818377 | |||
|
|
dcef391438 | ||
|
|
4d5da7bd2c | ||
| c2bd6da20e | |||
|
|
a309f7664a | ||
|
|
6176d24e9d | ||
| ac0ccebfb4 | |||
| 1be2402216 | |||
| d6f763748f | |||
| 304f32383f | |||
| c4c9b3f9ea | |||
| ec9e75fe3f | |||
| b259eab108 | |||
| 202af252c8 | |||
| 927741992d | |||
| 8c138a7485 | |||
| 2ca0c5c8e4 | |||
| cdf57a8b14 | |||
| d4475db152 | |||
| cc3c534474 | |||
| eecb07b6f2 |
@@ -1,15 +0,0 @@
|
||||
name: Hello world
|
||||
|
||||
on:
|
||||
- push
|
||||
|
||||
jobs:
|
||||
say-hello:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Print hello
|
||||
run: echo "Hello, world! from Gitea Actions"
|
||||
|
||||
@@ -8,11 +8,17 @@ on:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
|
||||
env:
|
||||
REMOTE_DEPLOY_PATH: /tmp/app # Change to your remote deploy base path
|
||||
# Base path for PR preview environments
|
||||
REMOTE_DEPLOY_PATH: /var/app/test/test
|
||||
|
||||
# --- CUSTOMIZABLE PRODUCTION PATH ---
|
||||
# Set the absolute path for your production deployment on the remote server.
|
||||
REMOTE_PROD_PATH: /var/app/test/test-prod
|
||||
|
||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||
SSH_USER: ${{ secrets.SSH_USER }}
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
SSH_PORT: ${{ secrets.SSH_PORT || 22 }} # Default to port 22 if not set
|
||||
SSH_PORT: ${{ secrets.SSH_PORT || 22 }}
|
||||
|
||||
jobs:
|
||||
prepare_deployment_vars:
|
||||
@@ -24,14 +30,18 @@ jobs:
|
||||
- name: Set deployment variables
|
||||
id: set-vars
|
||||
run: |
|
||||
REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2)
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
DEPLOY_DIR_NAME="pr-${{ github.event.pull_request.number }}"
|
||||
# For PRs, create a unique directory under the base path
|
||||
DEPLOY_PATH="${REMOTE_DEPLOY_PATH}/${REPO_NAME}-pr-${{ github.event.pull_request.number }}"
|
||||
else
|
||||
DEPLOY_DIR_NAME="main"
|
||||
# For 'main' branch, use the specified production path.
|
||||
# Fallback to a default if REMOTE_PROD_PATH is empty.
|
||||
DEPLOY_PATH="${REMOTE_PROD_PATH:-${REMOTE_DEPLOY_PATH}/main}"
|
||||
fi
|
||||
echo "DEPLOY_PATH=${REMOTE_DEPLOY_PATH}/${DEPLOY_DIR_NAME}" >> $GITHUB_ENV
|
||||
echo "deploy_path=${REMOTE_DEPLOY_PATH}/${DEPLOY_DIR_NAME}" >> $GITHUB_OUTPUT
|
||||
echo "DEPLOY_PATH will be: ${REMOTE_DEPLOY_PATH}/${DEPLOY_DIR_NAME}"
|
||||
echo "DEPLOY_PATH=${DEPLOY_PATH}" >> $GITHUB_ENV
|
||||
echo "deploy_path=${DEPLOY_PATH}" >> $GITHUB_OUTPUT
|
||||
echo "DEPLOY_PATH will be: ${DEPLOY_PATH}"
|
||||
|
||||
create_remote_directory:
|
||||
name: Create remote directory
|
||||
@@ -42,7 +52,7 @@ jobs:
|
||||
|| github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Setup SSH
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
|
||||
with:
|
||||
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
|
||||
|
||||
@@ -50,7 +60,6 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
echo "Scanning SSH host key for $SSH_HOST:$SSH_PORT..."
|
||||
ssh-keyscan -p "$SSH_PORT" -T 10 -H "$SSH_HOST" >> ~/.ssh/known_hosts 2>/dev/null || {
|
||||
echo "::error::Failed to ssh-keyscan $SSH_HOST:$SSH_PORT"
|
||||
exit 1
|
||||
@@ -58,7 +67,7 @@ jobs:
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
|
||||
- name: Create directory on remote
|
||||
run: ssh -p "$SSH_PORT" $SSH_USER@$SSH_HOST "mkdir -p ${{ needs.prepare_deployment_vars.outputs.deploy_path }}"
|
||||
run: ssh -p "$SSH_PORT" $SSH_USER@$SSH_HOST "mkdir -p '${{ needs.prepare_deployment_vars.outputs.deploy_path }}'"
|
||||
|
||||
sync_repo_files:
|
||||
name: Sync repository files
|
||||
@@ -68,14 +77,11 @@ jobs:
|
||||
(github.event_name == 'pull_request' && github.event.action != 'closed' && github.event.pull_request.merged == false)
|
||||
|| github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: asd
|
||||
run:
|
||||
ls -alh
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
|
||||
- name: Sync files via scp
|
||||
uses: appleboy/scp-action@master
|
||||
uses: appleboy/scp-action@6dba043acb2fa9973346e5025373dd76f2a50779 # master
|
||||
with:
|
||||
host: ${{ env.SSH_HOST }}
|
||||
username: ${{ env.SSH_USER }}
|
||||
@@ -83,13 +89,6 @@ jobs:
|
||||
port: ${{ env.SSH_PORT }}
|
||||
source: "./"
|
||||
target: "${{ needs.prepare_deployment_vars.outputs.deploy_path }}"
|
||||
#target: "/tmp/app/main"
|
||||
debug: true
|
||||
# The 'exclude' parameter is supported and should be kept
|
||||
# exclude: |
|
||||
# .git/
|
||||
# .github/
|
||||
# node_modules/
|
||||
|
||||
run_docker_compose:
|
||||
name: Run docker-compose remotely
|
||||
@@ -100,7 +99,7 @@ jobs:
|
||||
|| github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Setup SSH
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
|
||||
with:
|
||||
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
|
||||
|
||||
@@ -108,7 +107,6 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
echo "Scanning SSH host key for $SSH_HOST:$SSH_PORT..."
|
||||
ssh-keyscan -p "$SSH_PORT" -T 10 -H "$SSH_HOST" >> ~/.ssh/known_hosts 2>/dev/null || {
|
||||
echo "::error::Failed to ssh-keyscan $SSH_HOST:$SSH_PORT"
|
||||
exit 1
|
||||
@@ -116,18 +114,18 @@ jobs:
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
|
||||
- name: Run docker-compose on remote host
|
||||
run: ssh -p "$SSH_PORT" $SSH_USER@$SSH_HOST "cd ${{ needs.prepare_deployment_vars.outputs.deploy_path }} && docker-compose up -d --build"
|
||||
run: ssh -p "$SSH_PORT" $SSH_USER@$SSH_HOST "cd '${{ needs.prepare_deployment_vars.outputs.deploy_path }}' && docker-compose up -d --build"
|
||||
|
||||
cleanup_mr_environment:
|
||||
name: Cleanup MR environment
|
||||
runs-on: ubuntu-latest
|
||||
needs: [prepare_deployment_vars, prepare_deployment_vars]
|
||||
needs: prepare_deployment_vars
|
||||
if: |
|
||||
github.event_name == 'pull_request' &&
|
||||
(github.event.action == 'closed' || github.event.pull_request.merged == true)
|
||||
steps:
|
||||
- name: Setup SSH
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
|
||||
with:
|
||||
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
|
||||
|
||||
@@ -135,13 +133,15 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
echo "Scanning SSH host key for $SSH_HOST:$SSH_PORT..."
|
||||
ssh-keyscan -p "$SSH_PORT" -T 10 -H "$SSH_HOST" >> ~/.ssh/known_hosts 2>/dev/null || {
|
||||
echo "::error::Failed to ssh-keyscan $SSH_HOST:$SSH_PORT"
|
||||
exit 1
|
||||
}
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
|
||||
- name: Run docker-compose down on remote host
|
||||
run: ssh -p "$SSH_PORT" $SSH_USER@$SSH_HOST "cd '${{ needs.prepare_deployment_vars.outputs.deploy_path }}' && docker-compose down"
|
||||
|
||||
- name: Delete deployment directory
|
||||
run: |
|
||||
ssh -p "$SSH_PORT" $SSH_USER@$SSH_HOST "if [ -d '${{ needs.prepare_deployment_vars.outputs.deploy_path }}' ]; then rm -rf '${{ needs.prepare_deployment_vars.outputs.deploy_path }}'; echo 'Directory removed.'; else echo 'Directory not found, skipping.'; fi"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
web:
|
||||
image: nginx:1.26.1-alpine3.19-slim
|
||||
image: nginx:1.31.3-alpine-slim@sha256:45b82ed5f285b90d63df07ba70430fdd8f25624b416617d9e6dc93412b2006dc
|
||||
ports:
|
||||
- "80"
|
||||
volumes:
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<title>Helló világ!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello, World! 👋</h1>
|
||||
<h1>Sziasztok, emberek! 👋</h1>
|
||||
<h2>Másik szöveg</h2>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
15
renovate.json
Normal file
15
renovate.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
],
|
||||
// "packageRules": [
|
||||
// {
|
||||
// "matchCategories": [
|
||||
// "docker"
|
||||
// ],
|
||||
// "pinDigests": true
|
||||
// }
|
||||
// ],
|
||||
"pinDigests": true
|
||||
}
|
||||
Reference in New Issue
Block a user