Skip to content

chore: add initial workflow for adev build #12

chore: add initial workflow for adev build

chore: add initial workflow for adev build #12

# This workflow builds the previews for pull requests when a certain label is applied.
# The actual deployment happens as part of a dedicated second workflow to avoid security
# issues where the building would otherwise occur in an authorized context where secrets
# could be leaked. More details can be found here:
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
name: Build adev for preview deployment
on:
pull_request:
types: [synchronize, labeled]
permissions: read-all
env:
BAZEL_REPO_CACHE_PATH: '~/.cache/bazel_repo_cache'
jobs:
adev-build:
runs-on: ubuntu-latest
if: |
(github.event.action == 'labeled' && github.event.label.name == 'adev: preview') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'adev: preview'))
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: yarn
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: true
repository-cache: true
- run: yarn install
- run: yarn build
- run: chmod 755 build/dist/bin/adev/build/browser
- name: Inject pull request number
run: echo "${{ github.event.pull_request.number }}" >> __metadata__pull_number.txt
working-directory: build/dist/bin/adev/build/browser
- name: Inject commit hash
run: echo "${{ github.sha }}" >> __metadata__commit_hash.txt
working-directory: build/dist/bin/adev/build/browser
- uses: actions/upload-artifact@v4
with:
name: adev-preview
path: build/dist/bin/adev/build/browser