From 9d27ee5d666c1e40d12114d0f88ba6c2219229cb Mon Sep 17 00:00:00 2001 From: fmacleal Date: Thu, 27 Jun 2024 19:18:14 +0200 Subject: [PATCH] Fixing the pipeline to login and push always --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61a52615..04bf1392 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ on: permissions: contents: read packages: write +env: + TEST_TAG: ${{ github.event.repository.name }}/rit-action:test + LATEST_TAG: ${{ github.event.repository.name }}/rit-action:latest jobs: build-push-rit-action-image: @@ -36,19 +39,36 @@ jobs: platforms: linux/amd64 - name: GitHub container registry login - if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and export to Docker + uses: docker/build-push-action@v6 + with: + context: .github/images + load: true + tags: ${{ env.TEST_TAG }} + + - name: Test the RIT Container Action + id: test-container + env: + RSKJ_BRANCH: 'master' + FEDERATOR_BRANCH: 'master' + run: | + docker run \ + --env RSKJ_BRANCH="${{ env.RSKJ_BRANCH }}" \ + --env FEDERATOR_BRANCH="${{ env.FEDERATOR_BRANCH }}" \ + --rm ${{ env.TEST_TAG }} + - name: Build and push the RIT Action Container Image uses: docker/build-push-action@v6 with: context: .github/images push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ env.LATEST_TAG }} labels: ${{ steps.meta.outputs.labels }} test-rit-action: