[D2AI] Build Update #6361
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Build | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths-ignore: | |
- 'docs/**' | |
# Ensures that only one deploy task per branch/environment will run at a time. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
environment: | |
name: pr | |
url: ${{ steps.deploy-url.outputs.url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: pnpm | |
- name: Install | |
run: pnpm install --frozen-lockfile --prefer-offline | |
- name: get-npm-version | |
id: package-version | |
uses: martinbeentjes/[email protected] | |
- name: set beta | |
run: | | |
echo "build_level='beta'" >> $GITHUB_ENV | |
- name: Bump release version (beta) | |
run: | | |
echo "VERSION=${{ steps.package-version.outputs.current-version }}.${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Build PR version | |
run: pnpm build:pr | |
env: | |
NODE_OPTIONS: "--max_old_space_size=8192" | |
WEB_API_KEY: ${{ secrets.BUNGIE_API_KEY }} | |
WEB_OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }} | |
WEB_OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_SECRET }} | |
DIM_API_KEY: ${{ secrets.DIM_API_KEY }} | |
PUBLIC_PATH: /${{ github.event.number }}/ | |
- name: Check for updates to build pipeline | |
id: filter | |
uses: dorny/paths-filter@v3 | |
with: | |
filters: | | |
build-pipeline: | |
- package.json | |
- pnpm.lock | |
- config/webpack.ts | |
- babel.config.js | |
- name: Send webpack stats to RelativeCI | |
if: ${{ steps.filter.outputs.build-pipeline == 'true' }} | |
uses: relative-ci/agent-action@v2 | |
with: | |
webpackStatsFile: ./webpack-stats.json | |
key: ${{ secrets.RELATIVE_CI_KEY }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Deploy a preview version of the server! | |
- name: Install SSH key | |
if: ${{github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'}} | |
uses: benoitchantre/[email protected] | |
with: | |
private-key: ${{ secrets.SSH_KEY }} | |
private-key-name: dim.rsa | |
known-hosts: ${{ secrets.REMOTE_HOST }} | |
- name: Check Syntax | |
if: ${{github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'}} | |
run: pnpm syntax | |
- name: Rsync to Server | |
if: ${{github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'}} | |
run: ./build/rsync-deploy.sh | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }} | |
SOURCE: "dist/" | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_PATH: pr.destinyitemmanager.com/${{ github.event.number }} | |
- name: Purge CloudFlare cache | |
if: ${{github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'}} | |
run: ./build/purge-cloudflare.sh | |
env: | |
CLOUDFLARE_KEY: ${{ secrets.CLOUDFLARE_KEY }} | |
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} | |
APP_DOMAIN: pr.destinyitemmanager.com/${{ github.event.number }} | |
- name: Set preview deployment URL | |
if: ${{github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'}} | |
id: deploy-url | |
run: | | |
echo "url=https://pr.dim.gg/${{ github.event.number }}/" >> $GITHUB_OUTPUT |