Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github publishing workflow for etos-iut #74

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,39 @@ 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:
andmat900 marked this conversation as resolved.
Show resolved Hide resolved
iutVersion: ${{ steps.image.outputs.version }}
update_manifests:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
needs: [build_api, build_sse, build_logarea]
needs: [build_api, build_sse, build_logarea, build_iut]
steps:
- uses: actions/checkout@v3
- name: Update manifests
Expand All @@ -114,8 +143,11 @@ jobs:
},
"manifests/base/logarea/deployment.yaml": {
"spec.template.spec.containers[0].image": "registry.nordix.org/eiffel/etos-logarea:${{ needs.build_logarea.outputs.logAreaVersion }}"
},
"manifests/base/iut/deployment.yaml": {
"spec.template.spec.containers[0].image": "registry.nordix.org/eiffel/etos-iut:${{ needs.build_iut.outputs.iutVersion }}"
}
}
branch: main
commitChange: true
message: Updating SSE image to ${{ needs.build_sse.outputs.sseVersion }}, LogArea image to ${{ needs.build_logarea.outputs.logAreaVersion }} and API image to ${{ needs.build_api.outputs.apiVersion }}
message: Updating SSE image to ${{ needs.build_sse.outputs.sseVersion }}, LogArea image to ${{ needs.build_logarea.outputs.logAreaVersion }}, IUT image to ${{ needs.build_iut.outputs.iutVersion }} and API image to ${{ needs.build_api.outputs.apiVersion }}
Loading