From 978f08ef70bd82e3f421f97f5cf611520d78d546 Mon Sep 17 00:00:00 2001 From: s3rj1k Date: Tue, 24 Sep 2024 18:55:39 +0200 Subject: [PATCH] fix --- .github/workflows/build.yml | 73 +++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ca6faf..1f848db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,8 +14,8 @@ concurrency: group: ${{ github.head_ref || github.ref }} jobs: - deb-fsa: - name: 'DEB-FSA' + deb: + name: 'DEB' permissions: id-token: write contents: read @@ -36,17 +36,14 @@ jobs: runner: ubuntu-latest - name: arm64v8 runner: ubuntu-latest - release: - - release - - unstable with: RUNNER: ${{ matrix.platform.runner }} ARTIFACTS_PATTERN: '.*\.(deb)$' - DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/fsa.${{ matrix.release }}.Dockerfile + DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/Dockerfile MAINTAINER: 'Andrey Volk ' - META_FILE_PATH_PREFIX: /var/www/libks/fsa/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }} + META_FILE_PATH_PREFIX: /var/www/libks/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }} PLATFORM: ${{ matrix.platform.name }} - TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-fsa-${{ matrix.release }}-artifact + TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact UPLOAD_BUILD_ARTIFACTS: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.title, ':upload-artifacts') }} secrets: GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }} @@ -55,12 +52,14 @@ jobs: USERNAME: ${{ secrets.USERNAME }} TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }} - deb-public: - name: 'DEB-PUBLIC' + + + deb-mirror: + name: 'DEB-MIRROR' + runs-on: ubuntu-latest permissions: id-token: write contents: read - uses: signalwire/actions-template/.github/workflows/cicd-docker-build-and-distribute.yml@main strategy: # max-parallel: 1 fail-fast: false @@ -80,28 +79,46 @@ jobs: release: - release - unstable - with: - RUNNER: ${{ matrix.platform.runner }} - ARTIFACTS_PATTERN: '.*\.(deb)$' - DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/public.${{ matrix.release }}.Dockerfile - MAINTAINER: 'Andrey Volk ' - META_FILE_PATH_PREFIX: /var/www/libks/public/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }} - PLATFORM: ${{ matrix.platform.name }} - TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-${{ matrix.release }}-artifact - UPLOAD_BUILD_ARTIFACTS: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.title, ':upload-artifacts') }} - secrets: - GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }} - HOSTNAME: ${{ secrets.HOSTNAME }} - PROXY_URL: ${{ secrets.PROXY_URL }} - USERNAME: ${{ secrets.USERNAME }} - TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }} + steps: + - name: Checkout reusable actions + uses: actions/checkout@v4 + with: + repository: signalwire/actions-template + ref: teleport-local-copy + fetch-depth: 1 + path: actions + sparse-checkout: | + .github/actions/teleport-local-copy/action.yml + sparse-checkout-cone-mode: false + + - name: Mirror artifacts on remote server behind Teleport (public) + uses: ./actions/.github/actions/teleport-local-copy + with: + SRC: '/var/www/libks/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz' + DST: '/var/www/libks/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' + env: + HOSTNAME: ${{ secrets.HOSTNAME }} + PROXY_URL: ${{ secrets.PROXY_URL }} + TOKEN: ${{ secrets.TELEPORT_TOKEN }} + USERNAME: ${{ secrets.USERNAME }} + + - name: Mirror artifacts on remote server behind Teleport (fsa) + uses: ./actions/.github/actions/teleport-local-copy + with: + SRC: '/var/www/libks/public/unstable/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}/${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-unstable-artifact.tar.gz' + DST: '/var/www/libks/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' + env: + HOSTNAME: ${{ secrets.HOSTNAME }} + PROXY_URL: ${{ secrets.PROXY_URL }} + TOKEN: ${{ secrets.TELEPORT_TOKEN }} + USERNAME: ${{ secrets.USERNAME }} meta: name: 'Publish build data to meta-repo' if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.title, ':upload-artifacts') }} needs: - - deb-fsa - - deb-public + - deb + - deb-mirror permissions: id-token: write contents: read