From e558554ddea7cac17ac7b6b54ed8054471ae1d2d Mon Sep 17 00:00:00 2001 From: Richard Lindhout Date: Fri, 23 Jun 2023 12:56:15 +0200 Subject: [PATCH] fix: release to s3 --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c5ee1f..f552c10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: uses: ./.github/actions/setup - name: Run unit tests - run: yarn test --maxWorkers=2 --coverage + run: yarn test --maxWorkers=2 --coverage --passWithNoTests build: runs-on: ubuntu-latest @@ -46,3 +46,42 @@ jobs: - name: Build package run: yarn prepack + release: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup + uses: ./.github/actions/setup + - name: git config + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc + - run: yarn release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + deploy-example: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup + uses: ./.github/actions/setup + - run: yarn build-example + - name: Deploy example + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: www.reactnativeuseform.com + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'eu-central-1' + SOURCE_DIR: 'example/web-build' # optional: defaults to entire repository