Skip to content

Commit

Permalink
fix: deploy cd
Browse files Browse the repository at this point in the history
  • Loading branch information
m4dm4rtig4n committed Jan 22, 2024
1 parent 84f4a52 commit 53d783b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
run: |
version=$(cat src/main.py |grep VERSION| awk '{print $3}' | tr -d '"')
echo "version=${version}" >> "$GITHUB_ENV"
release_type=$(cat src/main.py |grep VERSION| awk '{print $3}' | tr -d '"'| grep rc)
if [ "$release_type" == "" ]; then
# RELEASE
echo "release_type=release" >> "GITHUB_OUTPUT"
else
# PRERELEASE
echo "release_type=prerelease" >> "GITHUB_OUTPUT"
fi
#################################################################################################################
# BUILD & PUSH IMAGE
Expand Down Expand Up @@ -56,7 +64,6 @@ jobs:
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
context: .
# platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
tags: |
m4dm4rtig4n/enedisgateway2mqtt:${{ needs.informations.outputs.version }}
Expand All @@ -68,11 +75,11 @@ jobs:
uses: Ilshidur/action-discord@master
with:
args: '**MyElectricalData** : **${{ needs.informations.outputs.version }}** image version is up to date'

##################################################################################################################
# LATEST-DEV
- name: Build and push
uses: docker/build-push-action@v2
# if: ${{ github.event.release.prerelease }}
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
Expand All @@ -84,28 +91,30 @@ jobs:
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
if: ${{ github.event.release.prerelease }}
with:
args: '**MyElectricalData** : **latest-dev** image version is up to date'

# ##################################################################################################################
# # LATEST
- name: Build and push
uses: docker/build-push-action@v2
if: ${{ !github.event.release.prerelease }}
if: ${{ needs.informations.outputs.release_type }} == "release"
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
tags: |
m4dm4rtig4n/enedisgateway2mqtt:latest
m4dm4rtig4n/myelectricaldata:latest
- name: Discord notification
if: ${{ !github.event.release.prerelease }}
if: ${{ needs.informations.outputs.release_type }} == "release"
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: '**MyElectricalData** : **latest** image version is up to date'

##################################################################################################################
# FINISH
- name: Discord notification
Expand Down

0 comments on commit 53d783b

Please sign in to comment.