diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..f8b6b18339 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build + +on: + push: + pull_request: + +jobs: + build: + name: Build artifacts + if: '!github.event.deleted' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + # Required to fetch all commits and tags + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + registry-url: 'https://npm.pkg.github.com' + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install Dependencies + run: yarn install + - name: Build artifacts + run: | + yarn build:css:prod + VERSION_FILE_NAME=$GITHUB_REPOSITORY \ + VERSION_FILE_VERSION=$(git describe --tags --exclude=latest) \ + yarn build:js:prod --json webpack-stats.json + - name: Upload build + uses: actions/upload-artifact@v1 + with: + name: dist + path: dist + - name: Upload webpack stats artifact + uses: relative-ci/agent-upload-artifact-action@v1 + with: + webpackStatsFile: ./webpack-stats.json diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 61f53cd5f5..270604fd77 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -75,36 +75,6 @@ jobs: - name: Lint Javascript run: yarn lint:js - build: - name: Build artifacts - if: '!github.event.deleted' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - # Required to fetch all commits and tags - fetch-depth: 0 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'yarn' - registry-url: 'https://npm.pkg.github.com' - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Dependencies - run: yarn install - - name: Build artifacts - run: | - VERSION_FILE_NAME=$GITHUB_REPOSITORY \ - VERSION_FILE_VERSION=$(git describe --tags --exclude=latest) \ - yarn build - - name: Upload - uses: actions/upload-artifact@v1 - with: - name: dist - path: dist - validate_docs: name: Validate documentation if: '!github.event.deleted' diff --git a/.github/workflows/relative_ci.yml b/.github/workflows/relative_ci.yml new file mode 100644 index 0000000000..ed9f46a163 --- /dev/null +++ b/.github/workflows/relative_ci.yml @@ -0,0 +1,17 @@ +name: RelativeCI + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Send webpack stats to RelativeCI + uses: relative-ci/agent-action@v2 + with: + key: ${{ secrets.RELATIVE_CI_KEY }} + token: ${{ secrets.GITHUB_TOKEN }}