Skip to content

Remove the STRIP_PREFIX option from API services (#313) #6

Remove the STRIP_PREFIX option from API services (#313)

Remove the STRIP_PREFIX option from API services (#313) #6

name: Generate Manifest File
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log into registry
run: echo "${{ secrets.REGISTRYPASSWORD }}" | docker login registry.nordix.org -u ${{ secrets.REGISTRYUSERNAME }} --password-stdin
- name: Clean workspace
run: |
rm -r dist | true
- name: Generate manifest file
run: |
IMAGE_ID=registry.nordix.org/eiffel/etos-controller
# 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
make docker-build docker-push build-installer IMG=$IMAGE_ID:$VERSION
mkdir -p manifests/controller
cp dist/* manifests/controller/
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Update install manifest"
git push origin main