diff --git a/.github/workflows/deploy-wasm.yml b/.github/workflows/deploy-wasm.yml new file mode 100644 index 0000000..c806561 --- /dev/null +++ b/.github/workflows/deploy-wasm.yml @@ -0,0 +1,37 @@ +name: Deploy WASM bundle + +on: + push: + branches: ["main", "develop"] + pull_request: + branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: "18" + + - name: Install dependencies and build + run: | + cd wasm + npm ci + npm run build + + - name: Setup AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-1 + + - name: Upload to S3 + run: | + aws s3 sync wasm/dist s3://zakfarmer-php-rs