web/.forgejo/workflows/build_and_test.yml
asandikci cef6f9be05
Some checks failed
Build and Deploy Test Version (with/without Drafts) - next.asandikci.com / build-drafts-and-deploy (push) Failing after 1m1s
lftp key verification
2024-11-16 00:20:35 +03:00

100 lines
No EOL
3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: "Build and Deploy Test Version (with/without Drafts) - next.asandikci.com"
on:
push:
branches:
- main
paths-ignore:
- .gitignore
- README.md
- LICENSE
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# build-and-push-prod:
# runs-on: docker
# container:
# image: git.asandikci.com/docker-images/website_builder:latest
# steps:
# - name: Git Clone
# run: |
# 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ıı (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
build-drafts-and-deploy:
runs-on: docker
container:
image: git.asandikci.com/docker-images/website_builder:latest
steps:
- name: Git Clone
run: |
git clone https://git.asandikci.com/asandikci.com/web
ls -la ./web
- name: Build Site (with Drafts!)
run: |
cd web
bundle install
bundle exec jekyll b --drafts
ls -la
pwd
env:
JEKYLL_ENV: "production"
# TODO: WILL BE FIXED
# - name: Test Site
# run: |
# cd web
# bundle exec htmlproofer _site \
# \-\-disable-external \
# \-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
- name: Deploy
run: |
mkdir deploy && cd deploy
ls -la
pwd
cp -rfv ../web/_site .
ls -la
lftp -c "set sftp:auto-confirm yes; set sftp:connect-program \"ssh -a -x -o UserKnownHostsFile=/dev/null\"; open --user ${{ secrets.SFTP_USERNAME }} --password ${{ secrets.SFTP_PASSWORD }}sftp://${{ vars.SFTP_HOST }}; rm -r www/; mirror -R . www/; quit"
# echo '${{ secrets.SFTP_PASSWORD }}' > ~/.passwd
# chmod 0400 ~/.passwd
# sshpass -f ~/.passwd sftp -oBatchMode=no -o StrictHostKeyChecking=accept-new -b - ${{ secrets.SFTP_USERNAME }}@${{ vars.SFTP_HOST }} << !
# rm www/*
# put -r . www/
# bye
# !