diff --git a/.github/build-package-pages.sh b/.github/build-package-pages.sh index 92911c3..37b3718 100755 --- a/.github/build-package-pages.sh +++ b/.github/build-package-pages.sh @@ -6,12 +6,12 @@ for row in $(cat $1 | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} } - touch $2/$(_jq '.name').md + touch $2/$(_jq '.slug').md content="--- type: page title: \"$(_jq '.name')\" Description: \"$(_jq '.desc')\" layout: \"package-detail\" ---" - echo "$content" > $2/$(_jq '.name').md + echo "$content" > $2/$(_jq '.slug').md done \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c71d9c8..013357c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -25,8 +25,13 @@ jobs: - uses: actions/checkout@v3 - # TODO: - # add action here to download updates packages.json into src/data/packages.json + - name: Copy packages.json summary from dist.tea.xyz + uses: prewk/s3-cp-action@v2 + with: + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + source: 's3://dist.tea.xyz/packages.json' + dest: './src/data/packages.json' - name: Create Package Detail Pages from packages.json uses: getneil/jq-action@v1 diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 470b87f..11d2a61 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -33,8 +33,13 @@ jobs: echo "relativeurls = true" >>config.toml working-directory: src - # TODO: - # add action here to download updates packages.json into src/data/packages.json + - name: Copy packages.json summary from dist.tea.xyz + uses: prewk/s3-cp-action@v2 + with: + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + source: 's3://dist.tea.xyz/mock_packages.json' + dest: './src/data/packages.json' - name: Create Package Detail Pages from packages.json uses: getneil/jq-action@v1 diff --git a/src/layouts/partials/detail-btn.html b/src/layouts/partials/detail-btn.html index c5de022..f7cb2f2 100644 --- a/src/layouts/partials/detail-btn.html +++ b/src/layouts/partials/detail-btn.html @@ -36,6 +36,6 @@ - + \ No newline at end of file diff --git a/src/layouts/partials/package-thumbnail.html b/src/layouts/partials/package-thumbnail.html index 0387e8f..a6ef00e 100644 --- a/src/layouts/partials/package-thumbnail.html +++ b/src/layouts/partials/package-thumbnail.html @@ -22,7 +22,7 @@ {{- partial "detail-btn.html" . -}}