From 96e3c717f9d2eba6c9df561eb6e33ad753a8028f Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 13 Mar 2025 14:56:52 +0100 Subject: [PATCH 1/6] new action --- .github/workflows/dtchsyn.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/dtchsyn.yml diff --git a/.github/workflows/dtchsyn.yml b/.github/workflows/dtchsyn.yml new file mode 100644 index 0000000..877f432 --- /dev/null +++ b/.github/workflows/dtchsyn.yml @@ -0,0 +1,28 @@ +on: + push: + branches: + - dev + - main +name: Publish Website +jobs: + web-deploy: + name: Deploy based on branch + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: SFTP upload + uses: Dylan700/sftp-upload-action@latest + with: + server: sftp.server.com + username: jason-bourne + password: ${{secrets.password}} + port: 22 + uploads: | + ./ => ./www/public_html/ + ignore: | + *.git + */**/*git* + *.json + config.php \ No newline at end of file -- 2.49.1 From 7381f0c64c4cdbfd13f0a7e2adfeae35caa90d20 Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 13 Mar 2025 14:58:10 +0100 Subject: [PATCH 2/6] juiste gegevens --- .github/workflows/dtchsyn.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dtchsyn.yml b/.github/workflows/dtchsyn.yml index 877f432..35e0827 100644 --- a/.github/workflows/dtchsyn.yml +++ b/.github/workflows/dtchsyn.yml @@ -15,9 +15,9 @@ jobs: - name: SFTP upload uses: Dylan700/sftp-upload-action@latest with: - server: sftp.server.com - username: jason-bourne - password: ${{secrets.password}} + server: ${{secrets.SYNADDR}} + username: ${{secrets.username}} + password: ${{secrets.SYNPASS}} port: 22 uploads: | ./ => ./www/public_html/ -- 2.49.1 From 468ce1d1848c9ad282c72f43e04c7569a581b532 Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 13 Mar 2025 15:02:50 +0100 Subject: [PATCH 3/6] s --- .github/workflows/main.yml | 72 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d272f1..17cf485 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,39 +1,39 @@ -on: - push: - branches: - - dev - - main +# on: +# push: +# branches: +# - dev +# - main -name: Publish Website -jobs: - web-deploy: - name: Deploy based on branch - runs-on: ubuntu-latest - steps: - - name: Get Latest Code - uses: actions/checkout@v3 +# name: Publish Website +# jobs: +# web-deploy: +# name: Deploy based on branch +# runs-on: ubuntu-latest +# steps: +# - name: Get Latest Code +# uses: actions/checkout@v3 - - name: Set destination path based on branch - id: set-destination - run: | - if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then - echo "DESTINATION=/var/www/dtch/" >> $GITHUB_ENV - else - echo "DESTINATION=/var/www/dtch_dev/" >> $GITHUB_ENV - fi +# - name: Set destination path based on branch +# id: set-destination +# run: | +# if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then +# echo "DESTINATION=/var/www/dtch/" >> $GITHUB_ENV +# else +# echo "DESTINATION=/var/www/dtch_dev/" >> $GITHUB_ENV +# fi - - name: Sync Files from ${{ github.ref }} - uses: SamKirkland/web-deploy@v1 - with: - target-server: ${{ secrets.DEST_SERVER }} - remote-user: stats - private-ssh-key: ${{ secrets.SSH_KEY }} - destination-path: ${{ env.DESTINATION }} - rsync-options: --no-times -r --include=config/clanmembers.json --exclude=.git* --exclude=*.json --exclude=.git/ --exclude=.github/ --exclude=config.php - - name: LINK TO WEBSITE - run: | - if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then - echo "Visit the production site at: https://dtch.online" - else - echo "Visit the dev site at: https://dev.dtch.online" - fi +# - name: Sync Files from ${{ github.ref }} +# uses: SamKirkland/web-deploy@v1 +# with: +# target-server: ${{ secrets.DEST_SERVER }} +# remote-user: stats +# private-ssh-key: ${{ secrets.SSH_KEY }} +# destination-path: ${{ env.DESTINATION }} +# rsync-options: --no-times -r --include=config/clanmembers.json --exclude=.git* --exclude=*.json --exclude=.git/ --exclude=.github/ --exclude=config.php +# - name: LINK TO WEBSITE +# run: | +# if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then +# echo "Visit the production site at: https://dtch.online" +# else +# echo "Visit the dev site at: https://dev.dtch.online" +# fi -- 2.49.1 From c8d20b822c20120a70e018c1fbb28a8cb3ce6b4d Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 13 Mar 2025 15:02:55 +0100 Subject: [PATCH 4/6] s --- .github/workflows/dtchsyn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dtchsyn.yml b/.github/workflows/dtchsyn.yml index 35e0827..1cb0ef9 100644 --- a/.github/workflows/dtchsyn.yml +++ b/.github/workflows/dtchsyn.yml @@ -20,7 +20,7 @@ jobs: password: ${{secrets.SYNPASS}} port: 22 uploads: | - ./ => ./www/public_html/ + ./ => ./Lantaeu/dtch_dev ignore: | *.git */**/*git* -- 2.49.1 From 1e5d688991ca83aeedfdccf9ba4e7c1ed3ca4ecc Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 13 Mar 2025 15:04:00 +0100 Subject: [PATCH 5/6] usern --- .github/workflows/dtchsyn.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dtchsyn.yml b/.github/workflows/dtchsyn.yml index 1cb0ef9..a25ef53 100644 --- a/.github/workflows/dtchsyn.yml +++ b/.github/workflows/dtchsyn.yml @@ -16,7 +16,7 @@ jobs: uses: Dylan700/sftp-upload-action@latest with: server: ${{secrets.SYNADDR}} - username: ${{secrets.username}} + username: ${{secrets.SYNUSR}} password: ${{secrets.SYNPASS}} port: 22 uploads: | -- 2.49.1 From fd355a627bc12fba581b8ffae48572bbb53c2c8f Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 13 Mar 2025 15:08:07 +0100 Subject: [PATCH 6/6] BRANCH BASED --- .github/workflows/dtchsyn.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dtchsyn.yml b/.github/workflows/dtchsyn.yml index a25ef53..72fbbea 100644 --- a/.github/workflows/dtchsyn.yml +++ b/.github/workflows/dtchsyn.yml @@ -3,12 +3,22 @@ on: 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 @@ -20,7 +30,7 @@ jobs: password: ${{secrets.SYNPASS}} port: 22 uploads: | - ./ => ./Lantaeu/dtch_dev + ./ => ${{ env.DESTINATION }} ignore: | *.git */**/*git* -- 2.49.1