Skip to content

Commit

Permalink
gh actions - realign with 2021.02.xx branch (#502)
Browse files Browse the repository at this point in the history
Reading the workflow spec, it does not seem to contain anything that
could not match the master branch, so it should be pretty safe to merge.
  • Loading branch information
pmauduit committed Apr 1, 2022
1 parent 38cd12c commit da92b52
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/mapstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,13 @@ jobs:
name: mapstore.war
path: scratch/mapstore-${{ github.sha }}.war

- name: Getting image tag
if: github.repository == 'georchestra/mapstore2-georchestra'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Building docker image"
if: github.repository == 'georchestra/mapstore2-georchestra'
if: github.repository == 'georchestra/mapstore2-georchestra' && github.event_name == 'push'
run: |
cp scratch/mapstore-${{ github.sha }}.war docker/MapStore-${{ steps.version.outputs.VERSION }}.war
docker build . -t georchestra/mapstore:${{ steps.version.outputs.VERSION }}
# mvn -B package dockerfile:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/mapstore:${{ steps.version.outputs.VERSION }} -settings settings.xml
working-directory: ${{ github.workspace }}
cp scratch/mapstore-${{ github.sha }}.war docker/MapStore-${GITHUB_REF_NAME}.war
docker build . -t georchestra/mapstore:$GITHUB_REF_NAME
# mvn -B package dockerfile:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/mapstore:$GITHUB_REF_NAME -settings settings.xml
- name: "Logging in docker.io"
if: github.repository == 'georchestra/mapstore2-georchestra' && github.event_name == 'push'
uses: azure/docker-login@v1
Expand All @@ -97,11 +92,18 @@ jobs:
- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/mapstore2-georchestra' && github.event_name == 'push'
run: |
docker tag georchestra/mapstore:${{ steps.version.outputs.VERSION }} georchestra/mapstore:latest
docker tag georchestra/mapstore:$GITHUB_REF_NAME georchestra/mapstore:latest
docker push georchestra/mapstore:latest
working-directory: ${{ github.workspace }}
- name: "Pushing tag to docker.io"
if: contains(github.ref, 'refs/tags/') && github.repository == 'georchestra/mapstore2-georchestra' && github.event_name == 'push'
- name: "Check if branch name matches 20YY.MM.XX release pattern"
# if ref_name (branch or tag) matches upstream versionning 2021.02.x OR geOr versionning 22.0.x(-geor)
id: check-branch
run: |
if [[ ${{ github.ref_name }} =~ ^20[0-9]{2}\.[0-9]{2}\..+$ || ${{ github.ref_name }} =~ ^2[0-9]\.[0-9]\..+$ ]]; then
echo "::set-output name=releasematch::true"
fi
- name: "Pushing release to docker.io"
if: steps.check-branch.outputs.releasematch == 'true' && github.repository == 'georchestra/mapstore2-georchestra' && github.event_name == 'push'
run: |
docker push georchestra/mapstore:${{ steps.version.outputs.VERSION }}
docker push georchestra/mapstore:$GITHUB_REF_NAME

0 comments on commit da92b52

Please sign in to comment.