From 5263082b31024606f957a59b1f5630479e4cde9e Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 30 Oct 2023 11:23:46 -0400 Subject: [PATCH] Enable customer branches (#592) --- .github/workflows/customer-docker.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/customer-docker.yml diff --git a/.github/workflows/customer-docker.yml b/.github/workflows/customer-docker.yml new file mode 100644 index 0000000000..5c0780e82e --- /dev/null +++ b/.github/workflows/customer-docker.yml @@ -0,0 +1,51 @@ +name: Customer Docker images + +on: + push: + branches: + - 'customer-*' + pull_request: + branches: + - 'customer-*' + +jobs: + docker-build: + strategy: + matrix: + runner: [ubicloud] + runs-on: ${{ matrix.runner }} + permissions: + contents: read + packages: write + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - uses: depot/setup-action@v1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2.1.0 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + + - name: Set Short Commit Hash + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: extract branch name suffix for customer + id: branch + run: echo "::set-output name=branch::$(echo ${{ github.ref }} | sed 's/customer-//g')" + + - name: Build (optionally publish) PeerDB Images + uses: depot/bake-action@v1 + with: + token: ${{ secrets.DEPOT_TOKEN }} + files: ./docker-bake.hcl + push: ${{ startsWith(github.ref, 'refs/heads/customer-') }} + env: + SHA_SHORT: dev-${{ steps.vars.outputs.sha_short }} + TAG: latest-${{ steps.branch.outputs.branch }}