Release/0.0.40 (#39) #50
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
development: | |
runs-on: ubuntu-latest | |
environment: Dev | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- id: preflight | |
name: Preflight Checks | |
run: | | |
ls -l /usr/local/bin | |
which helm | |
which kubectl | |
- id: kubeconfig | |
name: Kubectl Config | |
env: | |
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | |
run: | | |
if ! [ -d ~/.kube ]; then mkdir ~/.kube; fi | |
echo $KUBE_CONFIG | base64 -d > ~/.kube/config | |
chmod go-rwx ~/.kube/config | |
- id: clusterinfo | |
name: Cluster Info | |
run: | | |
kubectl cluster-info | |
- id: helm | |
name: Helm Upgrade | |
run: | | |
helm upgrade --install -f nttchart/values.yaml -f nttchart/values-dev.yaml ntt-infra nttchart | |
version: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
git config --global user.name "$GITHUB_ACTOR" | |
git config --global user.email "[email protected]" | |
export OLD_VERSION=`yq .version nttchart/Chart.yaml` | |
export NEW_VERSION=`echo "import os;vbits=os.environ.get('OLD_VERSION').rsplit('.');print('.'.join([*vbits[0:-1], str(int(vbits[-1])+1)]))" | python3` | |
echo "Migrating chart from $OLD_VERSION to $NEW_VERSION" | |
yq -i '.version = strenv(NEW_VERSION)' nttchart/Chart.yaml | |
export BRANCH="release/$NEW_VERSION" | |
echo "Checking out $BRANCH" | |
git checkout -b "$BRANCH" | |
git commit -m "Create chart version $BRANCH" nttchart/Chart.yaml | |
git push --set-upstream origin "$BRANCH" |