cyclops-CI #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cyclops-CI | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
description: Version to be used as release name and image tagging | |
permissions: | |
contents: write | |
jobs: | |
build-UI: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
run: | | |
TAG=${{ github.event.inputs.version }} | |
docker build cyclops-ui -t cyclopsui/cyclops-ui:$TAG | |
docker push cyclopsui/cyclops-ui:$TAG | |
build-controller: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
run: | | |
TAG=${{ github.event.inputs.version }} | |
docker build cyclops-ctrl -t cyclopsui/cyclops-ctrl:$TAG | |
docker push cyclopsui/cyclops-ctrl:$TAG | |
update-install-manifest: | |
needs: | |
- build-UI | |
- build-controller | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: update install manifest | |
run: | | |
TAG=${{ github.event.inputs.version }} | |
INSTALL_YAML=$GITHUB_WORKSPACE/install/cyclops-install.yaml | |
sed -i 's/cyclopsui\/cyclops-ctrl\:.*/cyclopsui\/cyclops-ctrl\:'$TAG'/' $INSTALL_YAML | |
sed -i 's/cyclopsui\/cyclops-ui\:.*/cyclopsui\/cyclops-ui\:'$TAG'/' $INSTALL_YAML | |
# update file | |
git fetch origin main | |
git checkout main | |
git config --global user.email "[email protected]" | |
git config --global user.name "petar-cvit" | |
git status | |
git add $INSTALL_YAML | |
git commit -m 'βοΈ update cyclops to '$TAG | |
git push origin HEAD:main | |
release: | |
needs: | |
- update-install-manifest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
run: | | |
CURRENT_TAG=$(git describe --tags --abbrev=0) | |
gh release create ${{ github.event.inputs.version }} \ | |
--repo="https://github.com/cyclops-ui/cyclops" \ | |
--title="${{ github.event.inputs.version }}" \ | |
--notes "Changes π: | |
$(git log $CURRENT_TAG...${{ github.event.inputs.version }} --pretty=format:'- [`%h`](https://github.com/cyclops-ui/cyclops/commit/%H): %s by ([%an](https://github.com/%an))' -- .) | |
--- | |
full changelog: `[$CURRENT_TAG...${{ github.event.inputs.version }}]`(https://github.com/cyclops-ui/cyclops/compare/$CURRENT_TAG...${{ github.event.inputs.version }})" |