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 }}