Update Simple Index #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Simple Index | |
on: | |
workflow_dispatch: | |
workflow_call: | |
env: | |
GH_TOKEN: ${{ github.token }} | |
BUCKET: wheelhouse | |
BUCKET_ACCESS_URL: https://wheelhouse.kafai.eu.org | |
AWS_S3_ENDPOINT_URL: https://86099e5f6de2cd6346db01f48072efa4.r2.cloudflarestorage.com | |
jobs: | |
deploy: | |
name: Build Simple Index Pages | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Setup Github CLI | |
uses: sersoft-gmbh/setup-gh-cli-action@v2 | |
- name: Setup AWS CLI | |
uses: unfor19/install-aws-cli-action@v1 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dumb-pypi | |
run: pip install https://github.com/chriskuehl/dumb-pypi/archive/refs/tags/v1.15.0.tar.gz | |
- name: Build Index | |
run: | | |
dumb-pypi --output-dir build \ | |
--title "Odoo Contrib Pypi" \ | |
--packages-url ${{ env.BUCKET_ACCESS_URL }} \ | |
--package-list-json <(aws s3api list-objects-v2 --endpoint-url ${{ env.AWS_S3_ENDPOINT_URL }} --bucket ${{ env.BUCKET }} --output json | jq -c '.Contents[] | {filename: .Key, upload_timestamp: .LastModified | sub("\\.[0-9]*";"") | sub("\\+00:00$";"Z") | fromdate}') | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Upload Page Artifacts | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: build | |
- name: Deploy Github Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |