95b96126c3
Motivation: We should just use GitHub Actions for the CI Modifications: - Adjust docker / docker compose files - Add different workflows and jobs to deploy and build the project Result: Don't depend on external CI services
49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: Deploy project
|
|
|
|
on:
|
|
push:
|
|
branches: [ "4.1", master ]
|
|
|
|
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
|