netty5/.github/workflows/ci-deploy.yml

86 lines
2.7 KiB
YAML
Raw Normal View History

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@v1
with:
path: ~/.m2/repository
key: deploy-linux-x86_64-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
deploy-linux-x86_64-${{ runner.os }}-maven-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.8
continue-on-error: true
with:
key: deploy-linux-x86_64-docker-cache-{hash}
restore-keys: |
deploy-linux-x86_64-docker-cache-
- 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
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@v1
with:
path: ~/.m2/repository
key: deploy-linux-aarch64-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
deploy-linux-aarch64-${{ runner.os }}-maven-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.8
continue-on-error: true
with:
key: deploy-linux-aarch64-docker-cache-{hash}
restore-keys: |
deploy-linux-aarch64-docker-cache-
- 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 deploy