Merge pull request #199 from OpzekerIT/dev

Sync to new environment
This commit is contained in:
Lanta 2025-03-13 15:10:28 +01:00 committed by GitHub
commit 4734d4ee3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 74 additions and 36 deletions

38
.github/workflows/dtchsyn.yml vendored Normal file
View file

@ -0,0 +1,38 @@
on:
push:
branches:
- dev
- main
name: Publish Website
jobs:
web-deploy:
name: Deploy based on branch
runs-on: ubuntu-latest
steps:
- name: Set destination path based on branch
id: set-destination
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "DESTINATION=/Lantaeu/dtch/" >> $GITHUB_ENV
else
echo "DESTINATION=/Lantaeu/dtch_dev/" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v4
- name: SFTP upload
uses: Dylan700/sftp-upload-action@latest
with:
server: ${{secrets.SYNADDR}}
username: ${{secrets.SYNUSR}}
password: ${{secrets.SYNPASS}}
port: 22
uploads: |
./ => ${{ env.DESTINATION }}
ignore: |
*.git
*/**/*git*
*.json
config.php

View file

@ -1,39 +1,39 @@
on: # on:
push: # push:
branches: # branches:
- dev # - dev
- main # - main
name: Publish Website # name: Publish Website
jobs: # jobs:
web-deploy: # web-deploy:
name: Deploy based on branch # name: Deploy based on branch
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- name: Get Latest Code # - name: Get Latest Code
uses: actions/checkout@v3 # uses: actions/checkout@v3
- name: Set destination path based on branch # - name: Set destination path based on branch
id: set-destination # id: set-destination
run: | # run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then # if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "DESTINATION=/var/www/dtch/" >> $GITHUB_ENV # echo "DESTINATION=/var/www/dtch/" >> $GITHUB_ENV
else # else
echo "DESTINATION=/var/www/dtch_dev/" >> $GITHUB_ENV # echo "DESTINATION=/var/www/dtch_dev/" >> $GITHUB_ENV
fi # fi
- name: Sync Files from ${{ github.ref }} # - name: Sync Files from ${{ github.ref }}
uses: SamKirkland/web-deploy@v1 # uses: SamKirkland/web-deploy@v1
with: # with:
target-server: ${{ secrets.DEST_SERVER }} # target-server: ${{ secrets.DEST_SERVER }}
remote-user: stats # remote-user: stats
private-ssh-key: ${{ secrets.SSH_KEY }} # private-ssh-key: ${{ secrets.SSH_KEY }}
destination-path: ${{ env.DESTINATION }} # destination-path: ${{ env.DESTINATION }}
rsync-options: --no-times -r --include=config/clanmembers.json --exclude=.git* --exclude=*.json --exclude=.git/ --exclude=.github/ --exclude=config.php # rsync-options: --no-times -r --include=config/clanmembers.json --exclude=.git* --exclude=*.json --exclude=.git/ --exclude=.github/ --exclude=config.php
- name: LINK TO WEBSITE # - name: LINK TO WEBSITE
run: | # run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then # if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "Visit the production site at: https://dtch.online" # echo "Visit the production site at: https://dtch.online"
else # else
echo "Visit the dev site at: https://dev.dtch.online" # echo "Visit the dev site at: https://dev.dtch.online"
fi # fi