Skip to content

Commit 9176219

Browse files
committed
[GHA] Add deb-mirror workflow job
1 parent 882b9d1 commit 9176219

File tree

1 file changed

+83
-3
lines changed

1 file changed

+83
-3
lines changed

.github/workflows/build.yml

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build and Distribute
22

33
on:
44
pull_request:
@@ -26,9 +26,9 @@ jobs:
2626
os:
2727
- debian
2828
version:
29+
- trixie
2930
- bookworm
3031
- bullseye
31-
- trixie
3232
platform:
3333
- name: amd64
3434
runner: ubuntu-latest
@@ -44,10 +44,90 @@ jobs:
4444
META_FILE_PATH_PREFIX: /var/www/spandsp/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}
4545
PLATFORM: ${{ matrix.platform.name }}
4646
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact
47-
UPLOAD_BUILD_ARTIFACTS: false
47+
UPLOAD_BUILD_ARTIFACTS: ${{ github.event_name != 'pull_request' }}
4848
secrets:
4949
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
5050
HOSTNAME: ${{ secrets.HOSTNAME }}
5151
PROXY_URL: ${{ secrets.PROXY_URL }}
5252
USERNAME: ${{ secrets.USERNAME }}
5353
TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }}
54+
55+
deb-mirror:
56+
name: 'DEB-MIRROR'
57+
if: ${{ github.event_name != 'pull_request' }}
58+
needs:
59+
- deb
60+
runs-on: ubuntu-latest
61+
permissions:
62+
id-token: write
63+
contents: read
64+
strategy:
65+
# max-parallel: 1
66+
fail-fast: false
67+
matrix:
68+
os:
69+
- debian
70+
version:
71+
- trixie
72+
- bookworm
73+
- bullseye
74+
platform:
75+
- name: amd64
76+
runner: ubuntu-latest
77+
- name: arm32v7
78+
runner: ubuntu-latest
79+
- name: arm64v8
80+
runner: ubuntu-latest
81+
release:
82+
- release
83+
- unstable
84+
steps:
85+
- name: Checkout reusable actions
86+
uses: actions/checkout@v4
87+
with:
88+
repository: signalwire/actions-template
89+
ref: main
90+
fetch-depth: 1
91+
path: actions
92+
sparse-checkout: |
93+
.github/actions/teleport-local-copy/action.yml
94+
sparse-checkout-cone-mode: false
95+
96+
- name: Mirror artifacts on remote server behind Teleport (public)
97+
uses: ./actions/.github/actions/teleport-local-copy
98+
with:
99+
SRC: '/var/www/spandsp/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz'
100+
DST: '/var/www/spandsp/public/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-${{ matrix.release }}-artifact.tar.gz'
101+
env:
102+
HOSTNAME: ${{ secrets.HOSTNAME }}
103+
PROXY_URL: ${{ secrets.PROXY_URL }}
104+
TOKEN: ${{ secrets.TELEPORT_TOKEN }}
105+
USERNAME: ${{ secrets.USERNAME }}
106+
107+
- name: Mirror artifacts on remote server behind Teleport (fsa)
108+
uses: ./actions/.github/actions/teleport-local-copy
109+
with:
110+
SRC: '/var/www/spandsp/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz'
111+
DST: '/var/www/spandsp/fsa/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-fsa-${{ matrix.release }}-artifact.tar.gz'
112+
env:
113+
HOSTNAME: ${{ secrets.HOSTNAME }}
114+
PROXY_URL: ${{ secrets.PROXY_URL }}
115+
TOKEN: ${{ secrets.TELEPORT_TOKEN }}
116+
USERNAME: ${{ secrets.USERNAME }}
117+
118+
meta:
119+
name: 'Publish build data to meta-repo'
120+
if: ${{ github.event_name != 'pull_request' }}
121+
needs:
122+
- deb
123+
- deb-mirror
124+
permissions:
125+
id-token: write
126+
contents: read
127+
uses: signalwire/actions-template/.github/workflows/meta-repo-content.yml@main
128+
with:
129+
META_CONTENT: '/var/www/spandsp/{fsa,public}/{release,unstable}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}'
130+
META_REPO: signalwire/bamboo_gha_trigger
131+
META_REPO_BRANCH: trigger/spandsp/${{ github.ref_name }}
132+
secrets:
133+
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}

0 commit comments

Comments
 (0)