2022-11-29 10:59:02 +01:00
|
|
|
name: Generate packages.element.io directory indexes
|
|
|
|
on:
|
2022-12-15 12:00:58 +01:00
|
|
|
# Trigger a rebuild of all indexes if the template gets updated
|
|
|
|
push:
|
|
|
|
branches: [develop]
|
|
|
|
paths:
|
|
|
|
- "packages.element.io/**"
|
2023-01-31 14:22:30 +01:00
|
|
|
# Trigger a daily rebuild for (mac-mini built) Nightly builds
|
2022-12-15 12:00:58 +01:00
|
|
|
schedule:
|
|
|
|
- cron: "0 11 * * *"
|
2023-02-22 14:51:19 +01:00
|
|
|
# Trigger after Nightly builds are deployed
|
2023-01-31 14:22:30 +01:00
|
|
|
workflow_run:
|
2023-02-22 14:51:19 +01:00
|
|
|
workflows: ["Build and Deploy"]
|
2023-01-31 14:22:30 +01:00
|
|
|
types:
|
|
|
|
- completed
|
2022-12-15 12:00:58 +01:00
|
|
|
# Manual trigger for rebuilding for releases
|
|
|
|
workflow_dispatch: {}
|
2022-11-29 10:59:02 +01:00
|
|
|
jobs:
|
2022-12-15 12:00:58 +01:00
|
|
|
deploy:
|
|
|
|
name: "Deploy"
|
2023-01-31 14:22:30 +01:00
|
|
|
if: github.event != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
|
2022-12-15 12:00:58 +01:00
|
|
|
runs-on: ubuntu-latest
|
2022-12-23 15:28:23 +01:00
|
|
|
environment: packages.element.io
|
2022-12-15 12:00:58 +01:00
|
|
|
env:
|
|
|
|
R2_BUCKET: "packages-element-io"
|
|
|
|
R2_URL: ${{ secrets.CF_R2_S3_API }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-11-29 10:59:02 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
cache: "yarn"
|
2022-11-29 10:59:02 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- name: Install Deps
|
|
|
|
run: "yarn install --pure-lockfile"
|
2022-11-29 10:59:02 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- name: Copy static files
|
|
|
|
if: github.event_name == 'push'
|
|
|
|
run: aws s3 cp --recursive packages.element.io/ s3://$R2_BUCKET/ --endpoint-url $R2_URL --region auto
|
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
2022-11-29 10:59:02 +01:00
|
|
|
|
2022-12-15 12:00:58 +01:00
|
|
|
- name: Generate directory indexes
|
|
|
|
run: scripts/generate-packages-index.ts
|
|
|
|
env:
|
|
|
|
CF_R2_S3_API: ${{ secrets.CF_R2_S3_API }}
|
|
|
|
CF_R2_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
|
|
|
CF_R2_TOKEN: ${{ secrets.CF_R2_TOKEN }}
|