Skip to content

chore: add initial workflow for adev build #13

chore: add initial workflow for adev build

chore: add initial workflow for adev build #13

# 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
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
bazelrc: |
# Print all the options that apply to the build.
# This helps us diagnose which options override others
# (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc)
build --announce_rc
# More details on failures
build --verbose_failures=true
# CI supports colors but Bazel does not detect it.
common --color=yes
- 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