diff --git a/.github/workflows/build_frontend_prs.yml b/.github/workflows/build_frontend_prs.yml new file mode 100644 index 0000000000..d8e0600bdb --- /dev/null +++ b/.github/workflows/build_frontend_prs.yml @@ -0,0 +1,25 @@ +name: Node.js CI + +on: + pull_request: + paths: + - frontend/** + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + strategy: + matrix: + node-version: [14.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install --frozen-lockfile + - run: yarn run test + - run: yarn run fmt:check diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index afea456143..3e2c3b8986 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,3 +28,14 @@ jobs: npm publish --tag ${TAG:-latest} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - 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: ${{ secrets.AWS_DEFAULT_REGION }} + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - name: Publish static assets to S3 + run: | + aws s3 cp frontend/build s3://getunleash-static/unleash/${{ steps.get_version.outputs.VERSION }} --recursive diff --git a/frontend/.github/stale.yml b/frontend/.github/stale.yml deleted file mode 100644 index 0d0b1c994d..0000000000 --- a/frontend/.github/stale.yml +++ /dev/null @@ -1 +0,0 @@ -_extends: .github diff --git a/frontend/.github/workflows/add-to-project.yml b/frontend/.github/workflows/add-to-project.yml deleted file mode 100644 index ce57699355..0000000000 --- a/frontend/.github/workflows/add-to-project.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Add new item to project board - -on: - issues: - types: - - opened - pull_request_target: - types: - - opened - -jobs: - add-to-project: - uses: unleash/.github/.github/workflows/add-item-to-project.yml@main - secrets: inherit diff --git a/frontend/.github/workflows/release.yml b/frontend/.github/workflows/release.yml deleted file mode 100644 index 0680a0d661..0000000000 --- a/frontend/.github/workflows/release.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: 'Release unleash-frontend' -on: - push: - tags: - - 'v*' - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - - steps: - - uses: actions/checkout@v3 - - name: Publish to npm - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - registry-url: 'https://registry.npmjs.org' - - run: | - yarn install --frozen-lockfile - - run: | - TAG=$(echo $GITHUB_REF_NAME | grep -oP '^v\d+\.\d+\.\d+-?\K(\w+)?') - npm publish --tag ${TAG:-latest} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - 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: ${{ secrets.AWS_DEFAULT_REGION }} - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Publish static assets to S3 - run: | - aws s3 cp build/ s3://getunleash-static/unleash/${{ steps.get_version.outputs.VERSION }} --recursive diff --git a/frontend/.github/workflows/release_changelog.yml b/frontend/.github/workflows/release_changelog.yml deleted file mode 100644 index 52d02d0151..0000000000 --- a/frontend/.github/workflows/release_changelog.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: 'Release changelog' -on: - push: - tags: - - 'v*' - -jobs: - release: - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Build changelog - id: github_release - uses: metcalfc/changelog-generator@v3.0.0 - with: - myToken: ${{ secrets.GITHUB_TOKEN }} - - name: Create release - uses: actions/create-release@v1 - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body: ${{ steps.github_release.outputs.changelog }} - prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} diff --git a/package.json b/package.json index 80e167c863..832da1137a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "build": "yarn build:frontend && yarn build:backend", "build:backend": "yarn run copy-templates && tsc --pretty", "build:frontend": "cd frontend && yarn build", - "prepare": "node scripts/husky-install && yarn run build && yarn build:frontend", + "prepare": "node scripts/husky-install && yarn run build", "test": "NODE_ENV=test PORT=4243 jest", "test:unit": "NODE_ENV=test PORT=4243 jest --testPathIgnorePatterns=src/test/e2e/**", "test:docker": "./scripts/docker-postgres.sh",