1
0
mirror of https://github.com/privacyguides/privacyguides.org.git synced 2025-08-21 18:29:16 +00:00
Files
privacyguides.org/.github/workflows/update-discussions.yml

67 lines
1.9 KiB
YAML

# SPDX-FileCopyrightText: 2024 Jonah Aragon <jonah@privacyguides.org>
#
# SPDX-License-Identifier: MIT
name: 🔄 Update Discussions
on:
workflow_dispatch:
schedule:
- cron: "*/30 * * * *"
permissions:
contents: read
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: read
environment:
name: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
fetch-depth: 1
- name: Create site/en directory
run: mkdir -p site/en
- name: Update Discussions
uses: yakubique/minio-download@v1.1.1
with:
endpoint: https://${{ vars.PROD_GARAGE_HOSTNAME }}
access_key: ${{ secrets.PROD_GARAGE_KEY_ID }}
secret_key: ${{ secrets.PROD_GARAGE_SECRET_KEY }}
bucket: ${{ vars.PROD_GARAGE_BUCKET }}
source: /en/index.html
target: ./site/en/
- name: Run generate-topics.sh for top posts
run: |
bash generate-topics.sh \
--source='https://discuss.privacyguides.net/top.json?period=weekly' \
--tag="top posts" \
--destination="./site/en/index.html" \
--count=3
- name: Run generate-topics.sh for latest posts
run: |
bash generate-topics.sh \
--source='https://discuss.privacyguides.net/latest.json' \
--tag="latest posts" \
--destination="./site/en/index.html" \
--count=12
- name: Upload modified index
uses: yakubique/minio-upload@v1.1.3
with:
endpoint: https://${{ vars.PROD_GARAGE_HOSTNAME }}
access_key: ${{ secrets.PROD_GARAGE_KEY_ID }}
secret_key: ${{ secrets.PROD_GARAGE_SECRET_KEY }}
bucket: ${{ vars.PROD_GARAGE_BUCKET }}
source: ./site/en/index.html
target: /en/index.html