diff --git a/.github/workflows/build-alpha.yml b/.github/workflows/build-alpha.yml index aa9113a664d..81ad50240fb 100644 --- a/.github/workflows/build-alpha.yml +++ b/.github/workflows/build-alpha.yml @@ -16,7 +16,7 @@ jobs: id-token: write defaults: run: - working-directory: ./pyscriptjs + working-directory: pyscriptjs steps: - name: Checkout @@ -43,6 +43,7 @@ jobs: - name: Build pyscript run: | npm run build + # Deploy to S3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1.6.1 @@ -50,4 +51,4 @@ jobs: aws-region: ${{secrets.AWS_REGION}} role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }} - name: Sync to S3 - run: aws s3 sync . s3://pyscript-static/alpha/ # What artifacts exactly need to be copied? + run: aws s3 sync --quiet ./examples/build/ s3://pyscript-static/alpha/ diff --git a/.github/workflows/build-latest.yml b/.github/workflows/build-latest.yml index fb19705d44c..7bbaf15e007 100644 --- a/.github/workflows/build-latest.yml +++ b/.github/workflows/build-latest.yml @@ -9,9 +9,11 @@ on: - .github/workflows/build-latest.yml # Test that workflow works when changed pull_request: # Run on any PR that modifies files in pyscriptjs/ + branches: + - main paths: - pyscriptjs/** - - .github/workflows/** + - .github/workflows/build-latest.yml # Test that workflow works when changed jobs: build: @@ -21,7 +23,7 @@ jobs: id-token: write defaults: run: - working-directory: ./pyscriptjs + working-directory: pyscriptjs steps: - name: Checkout @@ -48,11 +50,14 @@ jobs: - name: Build pyscript run: | npm run build + # Deploy to S3 - name: Configure AWS credentials + if: github.ref == 'refs/heads/main' # Only deploy on merge into main uses: aws-actions/configure-aws-credentials@v1.6.1 with: aws-region: ${{secrets.AWS_REGION}} role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }} - name: Sync to S3 - run: aws s3 sync . s3://pyscript-static/unstable/ # What artifacts exactly need to be copied? + if: github.ref == 'refs/heads/main' + run: aws s3 sync --quiet ./examples/build/ s3://pyscript-static/unstable diff --git a/.github/workflows/sync-examples.yml b/.github/workflows/sync-examples.yml index 980f0b606e1..a9619b6398f 100644 --- a/.github/workflows/sync-examples.yml +++ b/.github/workflows/sync-examples.yml @@ -16,14 +16,18 @@ jobs: id-token: write defaults: run: - working-directory: ./pyscriptjs/examples + working-directory: pyscriptjs/examples steps: + # Deploy to S3 + - name: Checkout + uses: actions/checkout@v3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1.6.1 with: aws-region: ${{secrets.AWS_REGION}} role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }} - name: Sync to S3 - run: aws s3 sync . s3://pyscript-static/examples/ + # Sync outdated or new files, delete ones no longer in source + run: aws s3 sync --quiet --delete . s3://pyscript-static/examples/ # Sync directory, delete what is not in source diff --git a/pyscriptjs/examples/toga/static/pyscript b/pyscriptjs/examples/toga/static/pyscript deleted file mode 120000 index 8fdb6a20f16..00000000000 --- a/pyscriptjs/examples/toga/static/pyscript +++ /dev/null @@ -1 +0,0 @@ -../../build \ No newline at end of file