Skip to content

Commit

Permalink
Add Github publishing workflow for etos-iut
Browse files Browse the repository at this point in the history
  • Loading branch information
andmat900 committed Sep 17, 2024
1 parent 070a4e5 commit 33ea82d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,36 @@ jobs:
echo "::set-output name=version::$VERSION"
outputs:
logAreaVersion: ${{ steps.image.outputs.version }}
build_iut:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build app image
run: docker build . -f deploy/etos-iut/Dockerfile --tag image

- name: Log into registry
run: echo "${{ secrets.REGISTRYPASSWORD }}" | docker login registry.nordix.org -u ${{ secrets.REGISTRYUSERNAME }} --password-stdin

- name: Push app image
id: image
run: |
IMAGE_ID=registry.nordix.org/eiffel/etos-iut
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=$(echo ${{ github.sha }} | cut -c1-8)
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
echo $IMAGE_ID:$VERSION
echo "::set-output name=version::$VERSION"
outputs:
logAreaVersion: ${{ steps.image.outputs.version }}

update_manifests:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
Expand Down

0 comments on commit 33ea82d

Please sign in to comment.