From dbc4232ae18aaec9b1f31a1d3ff828c623c6b3d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javier=20Mill=C3=A1n=20Acosta?=
<83466805+jmillanacosta@users.noreply.github.com>
Date: Thu, 2 May 2024 11:04:44 +0200
Subject: [PATCH] Add docker job, retrieve version tags before build
---
.github/workflows/buildandpush.yml | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/buildandpush.yml b/.github/workflows/buildandpush.yml
index 9ba51b7..6292d11 100644
--- a/.github/workflows/buildandpush.yml
+++ b/.github/workflows/buildandpush.yml
@@ -7,18 +7,18 @@ on:
push:
branches: [ "master" ]
paths:
- - 'setup.sh'
+ #- 'setup.sh'
- 'startup.sh'
- 'Dockerfile'
pull_request:
branches: [ "master" ]
paths:
- - 'setup.sh'
+ #- 'setup.sh'
- 'startup.sh'
- 'Dockerfile'
jobs:
- docker:
+ update-version:
runs-on: ubuntu-latest
steps:
-
@@ -51,18 +51,29 @@ jobs:
run: |
cat setup.sh | sed 's|BRIDGEDBWSVERSION=".\+"|BRIDGEDBWSVERSION="${{ env.BRIDGEDBWSVERSION }}"|g' > setup.sh
-# - name: Echo new BDBVERSION (debug)
-# run: |
-#
-# echo New release tag: ${{ env.BDBWSVERSION }}
-
+ - name: commit and push setup.sh # Test whether it is necessary to push before the docker action accesses repository from git context
+ run: |
+ git add setup.sh
+ git commit -m "Updated setup.sh with ${{ env.BDBVERSION }}-${{ env.BRIDGEDBWSVERSION }}"
+ git push
+
+ echo New release tag: ${{ env.BDBWSVERSION }}
+ docker:
+ runs-on: ubuntu-latest
+ steps:
+ -
+ name: Retrieve tags
+ run: |
+ wget https://raw.githubusercontent.com/bridgedb/BridgeDbWebservice/main/pom.xml
+ echo "BDBVERSION=$(cat pom.xml | grep -m 1 -oP "(?<=).*" | sed 's|||g')" >> $GITHUB_ENV
+ wget https://raw.githubusercontent.com/bridgedb/BridgeDbWebservice/main/pom.xml
+ echo "BRIDGEDBWSVERSION=$(cat pom.xml | grep -m 1 -oP "(?<=).*" | sed 's|||g')" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: bigcatum/bridgedb:${{ env.BDBVERSION }}-${{ env.BRIDGEDBWSVERSION }}
-
-
name: Build and push
uses: docker/build-push-action@v4