Skip to content

Commit

Permalink
Merge pull request #51 from jmillanacosta/patch-6
Browse files Browse the repository at this point in the history
Add docker job, retrieve version tags before build
  • Loading branch information
marvinm2 authored May 2, 2024
2 parents 9a7912b + dbc4232 commit 6b2f943
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/buildandpush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
-
Expand Down Expand Up @@ -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 "(?<=<bridgedb-version>).*" | sed 's|</bridgedb-version>||g')" >> $GITHUB_ENV
wget https://raw.githubusercontent.com/bridgedb/BridgeDbWebservice/main/pom.xml
echo "BRIDGEDBWSVERSION=$(cat pom.xml | grep -m 1 -oP "(?<=<version>).*" | sed 's|</version>||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
Expand Down

0 comments on commit 6b2f943

Please sign in to comment.