Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI for eoed-docs.eliatra.com #2

Merged
merged 7 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/workflows/add-untriaged.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/backport.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/delete_backport_branch.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/jekyll-build.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/link-checker.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/publish_site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Publish Website eoed-docs.eliatra.com

on:
workflow_dispatch:
push:
- 2.11.x-ee
pull_request:

env:
WEBSITE_URL: 'eoed-docs.eliatra.com'

jobs:
setup:
runs-on: ubuntu-latest
outputs:
ruby-version: '3.2'
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true

build:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ needs.setup.outputs.ruby-version }}
bundler-cache: true
- name: Update _config.yml
run: |
sed -i '/^url:/c\url: "https://${{ env.WEBSITE_URL }}"' _config.yml
- run: JEKYLL_FATAL_LINK_CHECKER=internal bundle exec jekyll build --future
- uses: actions/upload-artifact@v4
with:
name: site-artifacts
path: _site
retention-days: 1

deploy:
needs: build
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/download-artifact@v4
with:
name: site-artifacts
path: _site


- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SFTP_SSH_PRIVATE_KEY }}

- name: Upload Folder
run: |
sudo apt install lftp -y
lftp --version
echo "Start SFTP upload"
lftp -u ${{ secrets.SFTP_USERNAME }}, -e "set sftp:connect-program 'ssh -a -x -o StrictHostKeyChecking=no'; mirror --reverse --parallel=20 --verbose _site/ /var/www/${{ env.WEBSITE_URL }}/html/; quit" sftp://${{ secrets.SFTP_SERVER }}

post_deploy:
needs: deploy
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- name: Purge Cloudflare Cache
run: |
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.ELIATRA_CLOUDFLARE_ZONEID }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.ELIATRA_CLOUDFLARE_DECACHE_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}')
if [ "$STATUS_CODE" -ne 200 ]; then
echo "Cloudflare API call failed with status $STATUS_CODE"
exit 1
else
echo "Cloudflare cache purged successfully"
fi
22 changes: 0 additions & 22 deletions .github/workflows/vale.yml

This file was deleted.

2 changes: 2 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /