asandikci
771c31cf6c
Some checks failed
Build and Deploy Test Version (with Drafts!) - next.asandikci.com / build_deploy (push) Failing after 1m6s
73 lines
No EOL
2.1 KiB
YAML
73 lines
No EOL
2.1 KiB
YAML
name: "Build and Deploy Test Version (with 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_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
|
||
run: |
|
||
cd web
|
||
bundle install
|
||
bundle exec jekyll b --drafts
|
||
env:
|
||
JEKYLL_ENV: "production"
|
||
|
||
- 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: 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
|
||
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
|
||
|
||
- name: Checkout & Deploy
|
||
run: |
|
||
mkdir deploy && cd deploy
|
||
git clone https://git.asandikci.com/asandikci.com/web
|
||
cd web
|
||
git checkout website
|
||
cd _site
|
||
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 }} << !
|
||
put -r . www/
|
||
bye
|
||
! |