From a9b7c3ab9f98edc074cdb130c6ffef2721172b79 Mon Sep 17 00:00:00 2001 From: "SKh." Date: Mon, 4 Nov 2024 14:08:14 -0500 Subject: [PATCH] chore: add docker login for CI workflow --- .github/workflows/ci.yml | 15 +++++++++++++++ .github/workflows/playwright.yml | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c8cee934b..307ef5e24f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,8 @@ jobs: if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" needs: [test] runs-on: ubuntu-latest + permissions: + id-token: write strategy: matrix: include: @@ -130,6 +132,19 @@ jobs: run: npm exec playwright install chromium working-directory: ./${{ matrix.workingDir }} + - name: Get secrets for DockerHub login + uses: grafana/shared-workflows/actions/get-vault-secrets@main + with: + common_secrets: | + DOCKERHUB_USERNAME=dockerhub:username + DOCKERHUB_PASSWORD=dockerhub:password + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ env.DOCKERHUB_PASSWORD }} + - name: Start grafana server for e2e tests if: ${{ matrix.workingDir != 'myorg-nobackend-scenesapp' }} run: docker compose up -d diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c042e46c66..20fa6101f3 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -53,7 +53,8 @@ jobs: - name: Install Playwright Browsers run: npx playwright install --with-deps chromium - - uses: grafana/shared-workflows/actions/get-vault-secrets@main + - name: Get secrets for DockerHub login + uses: grafana/shared-workflows/actions/get-vault-secrets@main with: common_secrets: | DOCKERHUB_USERNAME=dockerhub:username