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 d1976d9
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 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 All @@ -35,21 +38,41 @@ jobs:
driver-opts: network=host
platforms: linux/amd64

- name: Build and export locally 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 the RIT Action Container Image
uses: docker/build-push-action@v6
with:
context: .github/images
tags: ${{ env.LATEST_TAG }}
labels: ${{ steps.meta.outputs.labels }}

- 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 push the RIT Action Container Image
uses: docker/build-push-action@v6
with:
context: .github/images
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Push RIT Action Container Image
run: |
docker push ${{ github.event.repository.name }}/rit-action:latest
test-rit-action:
needs: build-push-rit-action-image
Expand Down

0 comments on commit d1976d9

Please sign in to comment.