From 9f587e71e72c250000ad6661e68808ceeda9b3a8 Mon Sep 17 00:00:00 2001 From: asandikci Date: Sat, 16 Nov 2024 00:42:54 +0300 Subject: [PATCH] Update .forgejo/workflows/deploy_prod.yml --- .forgejo/workflows/deploy_prod.yml | 45 ++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/deploy_prod.yml b/.forgejo/workflows/deploy_prod.yml index ad1a489..709bd97 100644 --- a/.forgejo/workflows/deploy_prod.yml +++ b/.forgejo/workflows/deploy_prod.yml @@ -13,17 +13,44 @@ concurrency: cancel-in-progress: true jobs: - build_deploy: + build-and-push-prod: runs-on: docker container: - image: bitnami/minideb:bookworm-arm64 - steps: - - name: Setup System Resources & Settings + image: git.asandikci.com/docker-images/website_builder:latest + steps: + - name: Git Clone run: | - apt-get update -y - apt-get upgrade -y - apt-get install git sshpass -y + git clone https://git.asandikci.com/asandikci.com/web + ls -la ./web + + - name: Build Site + run: | + cd web + bundle install + bundle exec jekyll b + env: + JEKYLL_ENV: "production" + - name: Push to "website" branch + run: | + mkdir website_branch && cd website_branch + git clone https://git.asandikci.com/asandikci.com/web + cd web + git checkout website + rm -rfv ./_site/ + cp -rfv ../../web/_site . + git config --global user.name "Aliberk Sandıkçı (CI)" + git config --global user.email git+ci@asandikci.com + git add -A + git commit --all --message "Updated! [CI]" + git push https://asandikci:${{ secrets.PUSH_KEY }}@git.asandikci.com/asandikci.com/web + + + publish: + runs-on: docker + container: + image: git.asandikci.com/docker-images/website_builder:latest + steps: - name: Checkout & Deploy run: | git clone https://git.asandikci.com/asandikci.com/web @@ -35,4 +62,6 @@ jobs: sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME_PROD }}@${{ vars.SFTP_HOST_PROD }} << ! put -r . www/ bye - ! \ No newline at end of file + ! + + ## TODO: WILL BE REPLACED WITH NEW LFTP SETUP !!! \ No newline at end of file