Skip to content

Commit

Permalink
Merge pull request #2505 from signalwire/gha
Browse files Browse the repository at this point in the history
[GHA] Rework `pull_request_target` workflow.
  • Loading branch information
andywolk authored Jun 25, 2024
2 parents 987b340 + c8b8f0d commit f850f83
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 7 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-from-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build from fork

on:
pull_request_target:
types:
- ready_for_review
paths:
- '**'
- '!.github/'
workflow_dispatch:

concurrency:
group: ${{ github.head_ref || github.ref }}

jobs:
deb:
name: 'DEB'
strategy:
max-parallel: 1
fail-fast: true
matrix:
os:
- debian
version:
- bookworm
- bullseye
- buster
platform:
- name: amd64
runner: ubuntu-latest
- name: arm32v7
runner: linux-arm64-4-core-public
- name: arm64v8
runner: linux-arm64-4-core-public
exclude:
- version: bookworm
platform:
name: amd64
- version: bookworm
platform:
name: arm64v8
- version: bullseye

runs-on: ${{ matrix.platform.runner }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
path: code

- name: Checkout reusable actions
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: main
fetch-depth: 1
path: actions
sparse-checkout: |
.github/actions/docker-build-artifacts/action.yml
sparse-checkout-cone-mode: false

- name: Build artifacts via Docker
uses: ./actions/.github/actions/docker-build-artifacts
with:
REPO_DOMAIN: freeswitch.signalwire.com
PLATFORM: ${{ matrix.platform.name }}
DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/Dockerfile
MAINTAINER: 'Andrey Volk <[email protected]>'
WORKING_DIRECTORY: code
env:
REPO_USERNAME: 'SWUSERNAME'
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Build and Distribute

on:
pull_request_target:
types:
- ready_for_review
paths:
- '**'
- '!.github/'
pull_request:
push:
branches:
Expand All @@ -29,7 +23,7 @@ jobs:
run: |
JSON="[]"
if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "pull_request_target" ]]; then
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
JSON=$(jq -n '[
{
"version": "bookworm",
Expand Down

0 comments on commit f850f83

Please sign in to comment.