-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (89 loc) · 2.66 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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