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

Feature/rclone #15204

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
96 changes: 0 additions & 96 deletions .github/scripts/publish.js

This file was deleted.

41 changes: 33 additions & 8 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,22 @@ jobs:
exit 1
fi
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
node-version: '20'
- name: Install AWS SDK v3
run: npm install @aws-sdk/client-s3 @aws-sdk/client-cloudfront
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install and configure rclone
run: |
apt-get update
apt-get install -y rclone
mkdir -p ~/.config/rclone/
cat > ~/.config/rclone/rclone.conf << EOF
[docs-s3]
type = s3
provider = AWS
env_auth = true
EOF
- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -286,15 +297,29 @@ jobs:
if [ -n "$AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST" ]; then
tar -xf artifacts/dnsdist-html-docs-${{needs.build-docs.outputs.pdns_version}}/dnsdist-html-docs.tar
cp artifacts/dnsdist-${{needs.build-docs.outputs.pdns_version}}.pdf/dnsdist.pdf dnsdist-html-docs/
node .github/scripts/publish.js publish dnsdist.org dnsdist-html-docs /
rclone copy dnsdist-html-docs/ docs-s3:$AWS_S3_BUCKET_DOCS/dnsdist.org/
# Invalidate CloudFront cache for DNSdist
aws cloudfront create-invalidation \
--distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID_DNSDIST \
--paths "/*" \
--no-wait
fi
if [ -n "$AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS" ]; then
tar -xf artifacts/recursor-html-docs-${{needs.build-docs.outputs.pdns_version}}/rec-html-docs.tar
cp artifacts/PowerDNS-Recursor-${{needs.build-docs.outputs.pdns_version}}.pdf/PowerDNS-Recursor.pdf rec-html-docs/
node .github/scripts/publish.js publish docs.powerdns.com rec-html-docs /recursor
rclone copy rec-html-docs/ docs-s3:$AWS_S3_BUCKET_DOCS/docs.powerdns.com/recursor/

tar -xf artifacts/authoritative-html-docs-${{needs.build-docs.outputs.pdns_version}}/auth-html-docs.tar
cp artifacts/PowerDNS-Authoritative-${{needs.build-docs.outputs.pdns_version}}.pdf/PowerDNS-Authoritative.pdf auth-html-docs/
node .github/scripts/publish.js publish docs.powerdns.com auth-html-docs /authoritative
rclone copy auth-html-docs/ docs-s3:$AWS_S3_BUCKET_DOCS/docs.powerdns.com/authoritative/

tar -xf artifacts/website-${{needs.build-docs.outputs.pdns_version}}/website.tar
node .github/scripts/publish.js publish docs.powerdns.com website/docs.powerdns.com /
rclone copy website/docs.powerdns.com/ docs-s3:$AWS_S3_BUCKET_DOCS/docs.powerdns.com/

# Invalidate CloudFront cache for docs.powerdns.com
aws cloudfront create-invalidation \
--distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID_DOCS \
--paths "/*" \
--no-wait
fi