Skip to content

cyclops-ui-CI

cyclops-ui-CI #29

Workflow file for this run

name: cyclops-ui-CI
on:
push:
branches:
- main
paths:
- cyclops-ui/**
workflow_dispatch:
permissions:
contents: write
jobs:
cyclops-ui-CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bump ui version in latest file
run: |
git config pull.rebase false
git config pull.rebase true
git pull origin main
LATEST_VERSION_FILE=$GITHUB_WORKSPACE/install/ui-latest.txt
# get current version
VERSION=$(cat $LATEST_VERSION_FILE)
MAJOR=$(($(cut -d\. -f2 <<< $VERSION) + 1))
# bump
VERSION=v0.$MAJOR.0
echo $VERSION > $LATEST_VERSION_FILE
# update file
git config --global user.email "[email protected]"
git config --global user.name "petar-cvit"
git add -A
git commit -m 'ci update cyclops ui to '$VERSION
git push origin HEAD:main
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
run: |
LATEST_VERSION_FILE=$GITHUB_WORKSPACE/install/ui-latest.txt
# get current version
VERSION=$(cat $LATEST_VERSION_FILE)
docker build cyclops-ui -t petarcvit223/cyclops-ui:$VERSION
docker push petarcvit223/cyclops-ui:$VERSION
- name: Update install manifest
run: |
LATEST_VERSION_FILE=$GITHUB_WORKSPACE/install/ui-latest.txt
INSTALL_YAML=$GITHUB_WORKSPACE/install/cyclops-install.yaml
# get current version
VERSION=$(cat $LATEST_VERSION_FILE)
sed -i 's/petarcvit223\/cyclops-ui\:.*/petarcvit223\/cyclops-ui\:'$VERSION'/' $INSTALL_YAML
# update file
git config --global user.email "[email protected]"
git config --global user.name "petar-cvit"
git status
git add .
git commit -m 'ci update cyclops ui to '$VERSION
git push