Skip to content

Commit

Permalink
Add docker build and copy install manifest to manifests (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-persson authored Nov 27, 2024
1 parent 39ee83b commit 2ed2ab7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add-manifest-to-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
'${{ github.ref_name }}' manifests/controller/**
--repo '${{ github.repository }}'
16 changes: 15 additions & 1 deletion .github/workflows/generate-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,33 @@ 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: |
make build-installer
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]'
Expand Down

0 comments on commit 2ed2ab7

Please sign in to comment.