name: Deploy project on: push: branches: [ "4.1" ] schedule: - cron: '30 1 * * 1' # At 01:30 on Monday, every Monday. # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: deploy-linux-x86_64: runs-on: ubuntu-latest steps: - uses: s4u/maven-settings-action@v2.2.0 with: servers: | [{ "id": "sonatype-nexus-snapshots", "username": "${{ secrets.SONATYPE_USERNAME }}", "password": "${{ secrets.SONATYPE_PASSWORD }}" }] - uses: actions/checkout@v2 # Cache .m2/repository - uses: actions/cache@v2 env: cache-name: deploy-linux-x86_64-cache-m2-repository with: path: ~/.m2/repository key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-deploy-${{ env.cache-name }}- ${{ runner.os }}-deploy- # Enable caching of Docker layers - uses: satackey/action-docker-layer-caching@v0.0.8 env: docker-cache-name: deploy-linux-x86_64-cache-docker continue-on-error: true with: key: ${{ runner.os }}-deploy-${{ env.docker-cache-name }}-{hash} restore-keys: | ${{ runner.os }}-deploy-${{ env.docker-cache-name }}- - name: Build docker image run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build - name: Deploy snapshots run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run deploy deploy-linux-aarch64: runs-on: ubuntu-latest # We depend on the deploy of linux-x86_64 so we can download the dependencies needs: deploy-linux-x86_64 # Skip for now until we figured out how to deploy SNAPSHOTS with the the same timestamps if: ${{ false }} steps: - uses: s4u/maven-settings-action@v2.2.0 with: servers: | [{ "id": "sonatype-nexus-snapshots", "username": "${{ secrets.SONATYPE_USERNAME }}", "password": "${{ secrets.SONATYPE_PASSWORD }}" }] - uses: actions/checkout@v2 # Cache .m2/repository - uses: actions/cache@v2 env: cache-name: deploy-linux-aarch64-cache-m2-repository with: path: ~/.m2/repository key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-deploy-${{ env.cache-name }}- ${{ runner.os }}-deploy- # Enable caching of Docker layers - uses: satackey/action-docker-layer-caching@v0.0.8 env: docker-cache-name: deploy-linux-aarch64-cache-docker continue-on-error: true with: key: ${{ runner.os }}-deploy-${{ env.docker-cache-name }}-{hash} restore-keys: | ${{ runner.os }}-deploy-${{ env.docker-cache-name }}- - name: Build docker image run: docker-compose -f docker/docker-compose.centos-7.yaml build - name: Deploy snapshots run: docker-compose -f docker/docker-compose.centos-7.yaml run cross-compile-aarch64-deploy