Skip to content

Commit

Permalink
chore: debug build version check changes with version update
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Mar 7, 2024
1 parent a960a73 commit 5dc2226
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 35 deletions.
75 changes: 41 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
version: ${{ steps.changes.outputs.version }}
steps:
- uses: actions/checkout@v3

- uses: dorny/paths-filter@v2
id: changes
with:
Expand All @@ -29,49 +30,55 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v2
- run: |
VERSION=$(head -1 ./apps/api/karrio/server/VERSION)
NEW_VERSION=$(git diff --quiet ${{ github.event.before }} ${{ github.sha }} ./apps/api/karrio/server/VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
echo 'Checking variables... ${{ env.NEW_VERSION != '' }} | ${{ env.NEW_VERSION }} | ${{ env.VERSION }}'
- uses: actions/checkout@v3

- id: get_tag
run: |
cat ./apps/api/karrio/server/VERSION
echo "tag=$(cat ./apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV"
- name: Build karrio server image
if: ${{ env.NEW_VERSION != '' }}
run: |
echo 'Building karrio server:${{ env.VERSION }}...'
# ./bin/build-server-image-from-source ${{ env.VERSION }}
echo 'Building karrio server:${{ env.tag }}...'
./bin/build-server-image-from-source ${{ env.tag }}
- name: Push karrio server image
if: ${{ env.NEW_VERSION != '' }}
run: |
echo 'Pushing karrio server:${{ env.VERSION }}...'
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker push karrio/karrio-server:${{ env.VERSION }}
# dashboard-build:
echo 'Pushing karrio server:${{ env.tag }}...'
docker push karrio/server:${{ env.tag }}
docker tag karrio/server:${{ env.tag }} karrio/server:nightly
docker push karrio/server:nightly
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# id-token: write
dashboard-build:

needs: changes
if: ${{ needs.changes.outputs.version == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

# steps:
# - uses: actions/checkout@v2
steps:
- uses: actions/checkout@v3

- id: get_tag
run: |
cat ./apps/api/karrio/server/VERSION
echo "tag=$(cat ./apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV"
# - name: Build karrio dashboard image
# if: ${{ env.NEW_VERSION != '' }}
# run: |
# echo 'Building karrio dashboard:${{ env.VERSION }}...'
# # ./bin/build-dashboard-from-source ${{ env.VERSION }}
- name: Build karrio dashboard image
run: |
echo 'Building karrio dashboard:${{ env.tag }}...'
./bin/build-dashboard-image ${{ env.tag }}
# - name: Push karrio dashboard image
# if: ${{ env.NEW_VERSION != '' }}
# run: |
# echo 'Pushing karrio dashboard:${{ env.VERSION }}...'
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# # docker push karrio/karrio-dashboard:${{ env.VERSION }}
- name: Push karrio dashboard image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
echo 'Pushing karrio dashboard:${{ env.tag }}...'
docker push karrio/dashboard:${{ env.tag }}
docker tag karrio/dashboard:${{ env.tag }} karrio/dashboard:nightly
docker push karrio/dashboard:nightly
2 changes: 1 addition & 1 deletion apps/api/karrio/server/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.2.rc8
2024.2.rc8-dev

0 comments on commit 5dc2226

Please sign in to comment.