Merge branch 'main' of https://github.com/lunabrain-ai/lunabrain #102
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: build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/[email protected] | |
- name: Install Kubernetes tools | |
uses: yokawasa/[email protected] | |
with: | |
setup-tools: | | |
yq | |
yq: "4.16.2" | |
- name: Docker Build | |
run: docker build . -t lunabrain | |
# - if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main') }} | |
# run: exit 0 | |
# | |
# - name: Log into registry | |
# if: github.ref == 'refs/heads/main' | |
# run: echo "${{ secrets.GH_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
# | |
# - name: Push backend image | |
# if: github.ref == 'refs/heads/main' | |
# run: | | |
# SERVER_IMAGE_ID=ghcr.io/breadchris/sifty | |
# | |
# # Change all uppercase to lowercase | |
# SERVER_IMAGE_ID=$(echo $SERVER_IMAGE_ID | tr '[A-Z]' '[a-z]') | |
# | |
# # 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=latest | |
# | |
# echo SERVER_IMAGE_ID=$SERVER_IMAGE_ID | |
# echo VERSION=$VERSION | |
# | |
# docker tag lunabrain $SERVER_IMAGE_ID:$VERSION | |
# docker push $SERVER_IMAGE_ID:$VERSION | |
# | |
# yq -i e ".services.lunabrain.image |= \"$(docker inspect --format='{{index .RepoDigests 0}}' $SERVER_IMAGE_ID:$VERSION)\"" docker-compose.prod.yaml | |
# - name: Create commit | |
# id: create-commit | |
# if: github.ref == 'refs/heads/main' | |
# uses: stefanzweifel/git-auto-commit-action@v4 | |
# with: | |
# file_pattern: docker-compose.prod.yaml | |
# commit_message: "chore: update container hash [skip ci]" | |
# | |
# - run: sleep 10 | |
# | |
# - name: Invoke deploy on new commit | |
# if: success() && github.ref == 'refs/heads/main' | |
# uses: benc-uk/workflow-dispatch@v1 | |
# with: | |
# workflow: Kompose | |
# token: ${{ secrets.GH_TOKEN }} | |
# ref: master |