Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create prebid_custom.yml #11929

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/prebid_custom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Builds Prebid with custom modules

on:
workflow_dispatch:
inputs:
env:
default: "develop"
required: false
type: choice
options:
- development
- production
modules_list:
default: ""
required: true
type: string
tag:
default: "9.3.0"
required: true
type: string
client_id:
default: "none"
required: true
type: string
pbjs_global:
default: "pbjs"
required: true
type: string

jobs:
setup:
runs-on: ubuntu-latest
outputs:
modules_list: ${{ steps.vars.outputs.modules_list }}
steps:
- name: Create an array of modules
id: vars
run: echo "::set-output name=modules_list::$(jq 'split(",")' -Rc <(echo '${{ github.event.inputs.modules_list }}'))"

build:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout to tag
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Install dependencies
run: npm install

- name: Replace string in file
uses: MathieuSoysal/[email protected]
with:
file: package.json
old-string: pbjs
new-string: ${{ github.event.inputs.pbjs_global }}

- name: Build prebid
run: gulp build --modules=${{ needs.setup.outputs.modules_list }}

- name: Upload bundle to R2
uses: magicwallet/r2-upload@main
with:
endpoint: ${{ secrets.R2_ENDPOINT }}
access_key_id: ${{ secrets.R2_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.R2_ACCESS_SECRET_KEY }}
bucket: ${{ secrets.R2_BUCKET }}
file: ./build/dist/prebid.js
destination: '/${{ github.event.inputs.client_id }}/${{ github.event.inputs.env }}/prebid.min.js'
Loading