diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1d2beaa85b3..54b79bee00b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -55,6 +55,7 @@ jobs: deploy: needs: dspace-angular uses: dataquest-dev/dspace-angular/.github/workflows/deploy.yml@dtq-dev + if: ${{ github.event_name != 'pull_request' }} with: INSTANCE: '5' IMPORT: false diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 00000000000..54dfbbd80f8 --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -0,0 +1,27 @@ +name: Release + +on: + push: + tags: + - '**' + +env: + IMAGE_BASE_NAME: dataquest/dspace-angular + +jobs: + retag-FE-image: + steps: + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: retag image + run: | + docker pull ${{ env.IMAGE_BASE_NAME }}:${{ github.sha }} + docker tag ${{ env.IMAGE_BASE_NAME }}:${{ github.sha }} ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }} + + - name: push image + run: docker push ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }} + diff --git a/scripts/sourceversion.py b/scripts/sourceversion.py index 6ac25034273..73b8abf36f3 100644 --- a/scripts/sourceversion.py +++ b/scripts/sourceversion.py @@ -1,14 +1,29 @@ import subprocess +import sys from datetime import datetime +# when next editing this script, please introduce argparse. +# do not forget, it is called in BE by .github\workflows\reusable-docker-build.yml +# argparse must be introduced there. +# that action also calls BE version of this script, which is different (BE: scripts/sourceversion.py). +# It must also cooperate with argparse + +# the idea is, that this will be different on each branch, but could be possibly passed by argv/argparse +RELEASE_TAG_BASE='none' + if __name__ == '__main__': ts = datetime.now() - print(f"timestamp: {ts}") + # we have html tags, since this script ends up creating VERSION_D.html + print(f"