chore(deps): update gradle/wrapper-validation-action digest to b5418f5 #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build mod-remote-sync | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@b5418f5a58f5fd2eb486dd7efb368fe7be7eae45 | |
- name: Start containers | |
run: | | |
cd tools/testing | |
docker-compose up -d | |
- name: Build with Gradle | |
uses: gradle/[email protected] | |
with: | |
arguments: build | |
build-root-directory: service | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v1 | |
if: always() | |
with: | |
files: "service/build/test-results/**/*.xml" | |
- name: Prepare env for docker build | |
run: | | |
echo "module_name=$(grep info.app.name ./service/build/resources/main/META-INF/grails.build.info | cut -f2 -d=)" >> $GITHUB_ENV | |
echo "module_version=$(grep info.app.version ./service/build/resources/main/META-INF/grails.build.info | cut -f2 -d=)" >> $GITHUB_ENV | |
echo "is_snapshot=$(grep info.app.version ./service/build/resources/main/META-INF/grails.build.info | grep -i SNAPSHOT | wc -l)" >> $GITHUB_ENV | |
- name: Pre build info | |
run: echo "ref:${{github.REF}} module:${{env.module_name}} ver:${{env.module_version}} snap:${{env.is_snapshot}}" | |
- name: Publish Docker Image | |
if: ${{ ( github.ref == 'refs/heads/master' ) || ( github.ref == 'refs/heads/main' ) }} | |
run: | | |
cat ./service/gradle.properties | |
APP_VERSION=$(grep appVersion ./service/gradle.properties| cut -f2 -d=) | |
echo "APP_VERSION_2=`grep appVersion ./service/gradle.properties| cut -f2 -d=`" >> $GITHUB_ENV | |
echo "See https://github.com/marketplace/actions/build-and-push-docker-images" | |
echo "Also https://www.prestonlamb.com/blog/creating-a-docker-image-with-github-actions" | |
echo "Run number is $GITHUB_RUN_NUMBER" | |
echo "Parsed APP_VERSION to ${APP_VERSION}" | |
if [[ "${APP_VERSION}" =~ .*SNAPSHOT.* ]]; then | |
echo Publish as snapshot | |
# docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} $dockerRepo | |
# docker build . --file Dockerfile --tag $dockerRepo/folioci/mod-remote-sync:${APP_VERSION} | |
# docker build . --file Dockerfile --tag $dockerRepo/folioci/mod-remote-sync:snapshot-latest | |
# docker push $dockerRepo/folioci/mod-remote-sync:${APP_VERSION} | |
# docker push --all-tags $dockerRepo/folioci/mod-remote-sync | |
else | |
echo Publish as release | |
# docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} $dockerRepo | |
# docker build . --file Dockerfile --tag $dockerRepo/folioorg/mod-remote-sync:${APP_VERSION} --tag $dockerRepo/folioorg/mod-remote-sync:latest | |
# docker push $dockerRepo/folioorg/mod-remote-sync:${APP_VERSION} | |
# docker push $dockerRepo/folioorg/mod-remote-sync:latest | |
# docker push --all-tags $dockerRepo/folioorg/mod-remote-sync | |
fi | |
env: | |
dockerRepo: https://hub.docker.com | |
# - name: Docker Build | |
# run: docker build --pull=true --no-cache=true -t ${{ env.module_name }}:${{ env.module_version }} . | |
# - if: github.REF == 'refs/heads/master' && env.is_snapshot=='1' | |
# run: | | |
# echo "Publishing Docker images" | |
# docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} | |
# echo "Tag" | |
# docker tag ${{ env.module_name }}:${{ env.module_version }} $dockerRepo/${{ env.module_name }}:${{ env.module_version }} | |
# docker tag ${{ env.module_name }}:${{ env.module_version }} $dockerRepo/${{ env.module_name }}:snapshot-latest | |
# echo "Push" | |
# docker push $dockerRepo/${{ env.module_name }}:${{ env.module_version }} | |
# docker push $dockerRepo/${{ env.module_name }}:snapshot-latest | |
# env: | |
# dockerRepo: folioci | |
# Folio Docker image publishing | |
# Snapshots to folioci | |
# Releases to https://hub.docker.com/u/folioorg |