Skip to content

Commit

Permalink
Fixing the pipeline to login and push always
Browse files Browse the repository at this point in the history
  • Loading branch information
fmacleal committed Jun 27, 2024
1 parent 638a1be commit 001cde2
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -36,19 +39,35 @@ 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:
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:
Expand Down

0 comments on commit 001cde2

Please sign in to comment.