2020-12-22 18:33:14 +01:00
|
|
|
name: Deploy project
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-12-22 19:30:57 +01:00
|
|
|
branches: [ "4.1" ]
|
2020-12-22 18:33:14 +01:00
|
|
|
|
|
|
|
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
|
2020-12-23 09:16:29 +01:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: deploy-linux-x86_64-cache-m2-repository
|
2020-12-22 18:33:14 +01:00
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
2020-12-23 09:16:29 +01:00
|
|
|
key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
2020-12-22 18:33:14 +01:00
|
|
|
restore-keys: |
|
2020-12-23 09:16:29 +01:00
|
|
|
${{ runner.os }}-deploy-${{ env.cache-name }}-
|
|
|
|
${{ runner.os }}-deploy-
|
2020-12-22 18:33:14 +01:00
|
|
|
|
|
|
|
# Enable caching of Docker layers
|
|
|
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
2020-12-23 09:16:29 +01:00
|
|
|
env:
|
|
|
|
docker-cache-name: deploy-linux-x86_64-cache-docker
|
2020-12-22 18:33:14 +01:00
|
|
|
continue-on-error: true
|
|
|
|
with:
|
2020-12-23 09:16:29 +01:00
|
|
|
key: ${{ runner.os }}-deploy-${{ env.docker-cache-name }}-{hash}
|
2020-12-22 18:33:14 +01:00
|
|
|
restore-keys: |
|
2020-12-23 09:16:29 +01:00
|
|
|
${{ runner.os }}-deploy-${{ env.docker-cache-name }}-
|
2020-12-22 18:33:14 +01:00
|
|
|
|
|
|
|
- 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
|
2020-12-22 20:43:35 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
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
|
2020-12-23 09:16:29 +01:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: deploy-linux-aarch64-cache-m2-repository
|
2020-12-22 20:43:35 +01:00
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
2020-12-23 09:16:29 +01:00
|
|
|
key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
2020-12-22 20:43:35 +01:00
|
|
|
restore-keys: |
|
2020-12-23 09:16:29 +01:00
|
|
|
${{ runner.os }}-deploy-${{ env.cache-name }}-
|
|
|
|
${{ runner.os }}-deploy-
|
2020-12-22 20:43:35 +01:00
|
|
|
|
|
|
|
# Enable caching of Docker layers
|
|
|
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
2020-12-23 09:16:29 +01:00
|
|
|
env:
|
|
|
|
docker-cache-name: deploy-linux-aarch64-cache-docker
|
2020-12-22 20:43:35 +01:00
|
|
|
continue-on-error: true
|
|
|
|
with:
|
2020-12-23 09:16:29 +01:00
|
|
|
key: ${{ runner.os }}-deploy-${{ env.docker-cache-name }}-{hash}
|
2020-12-22 20:43:35 +01:00
|
|
|
restore-keys: |
|
2020-12-23 09:16:29 +01:00
|
|
|
${{ runner.os }}-deploy-${{ env.docker-cache-name }}-
|
2020-12-22 20:43:35 +01:00
|
|
|
|
|
|
|
- name: Build docker image
|
2020-12-22 21:01:25 +01:00
|
|
|
run: docker-compose -f docker/docker-compose.centos-7.yaml build
|
2020-12-22 20:43:35 +01:00
|
|
|
|
|
|
|
- name: Deploy snapshots
|
2020-12-22 21:21:39 +01:00
|
|
|
run: docker-compose -f docker/docker-compose.centos-7.yaml run cross-compile-aarch64-deploy
|