Skip to content

Publish GRETL documentation and website #59

Publish GRETL documentation and website

Publish GRETL documentation and website #59

Workflow file for this run

on:
workflow_dispatch:
inputs:
commit:
description: 'Commit SHA'
required: false
default: 'main'
# push:
# branches: main
name: Publish GRETL documentation and website
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout GRETL repo
uses: actions/checkout@v4
with:
repository: sogis/gretl
path: gretl
ref: ${{ github.event.inputs.commit }}
- name: Debug
run: |
echo Commit / Branch:
echo ${{ github.event.inputs.commit }}
- name: Debug
working-directory: gretl
run: |
pwd
ls -la
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Copy GRETL reference documentation
working-directory: gretl
run: |
cp -v gretl/src/docs/*.qmd ..
cp -vr gretl/src/docs/tasks ..
- name: Remove GRETL repo
run: |
rm -rf gretl
- name: Debug
run: |
pwd
ls -la
- name: Fix link
run: |
sed -i 's/publisher\.md/publisher.qmd/g' reference.qmd
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
- name: Debug
run: |
pwd
ls -la _site
- name: Zip quarto output
run: |
zip -r ${{ github.event.inputs.commit }}.zip _site
- name: Debug
run: |
ls -la
- name: Render and Publish
if: ${{ github.event.inputs.commit == 'main'}}
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create s3 config and credentials file
run: |
mkdir ~/.aws/
touch ~/.aws/config
touch ~/.aws/credentials
echo "[default]" > ~/.aws/config
echo "endpoint_url = ${{secrets.HETZNER_S3_ENDPOINT_URL}}" >> ~/.aws/config
echo "[default]" > ~/.aws/credentials
echo "aws_access_key_id = ${{secrets.HETZNER_S3_KEY_ID}}" >> ~/.aws/credentials
echo "aws_secret_access_key = ${{secrets.HETZNER_S3_SECRET_ACCESS_KEY}}" >> ~/.aws/credentials
- name: Debug
run: |
cat ~/.aws/config
cat ~/.aws/credentials
- name: Debug
run: |
aws s3 ls --region fsn1
# - name: Publish to S3
# run: |
# aws s3 cp ${{ github.event.inputs.commit }}.zip s3://ch-agi-geodaten-dev/ --acl public-read --region fsn1