web/.forgejo/workflows/build_and_test.yml

64 lines
1.7 KiB
YAML
Raw Normal View History

name: "Build and Deploy Test Version (with Drafts) - next.asandikci.com"
2020-07-28 21:27:40 +03:00
on:
push:
branches:
- main
2020-07-28 21:27:40 +03:00
paths-ignore:
2020-10-03 11:45:17 +03:00
- .gitignore
- README.md
- LICENSE
workflow_dispatch:
2020-07-28 21:27:40 +03:00
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
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
2024-11-16 00:12:37 +03:00
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: |
2024-11-16 00:12:37 +03:00
mkdir deploy && cd deploy
cp -rfv ../web/_site .
2024-11-16 00:31:18 +03:00
cd _site
# CURRENTLY USING PURE STFP FOR AUTH ONLY
# TODO: CHANGE THIS
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 }} << !
bye
!
lftp --user ${{ secrets.SFTP_USERNAME }} --password ${{ secrets.SFTP_PASSWORD }} sftp://${{ vars.SFTP_HOST }} -e "mirror -R --delete . www/"