Deploy Development Build #130
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: Deploy Development Build | |
on: | |
push: | |
# On push to "development" branch for relevant files | |
branches: | |
- development | |
paths: | |
- .github/** | |
- files/** | |
- Dockerfile | |
schedule: | |
# Run 05:00 UTC every TUE, FRI | |
- cron: "0 5 * * 2,5" | |
# On-demand push-button build, why not... | |
workflow_dispatch: | |
jobs: | |
get_latest_version: | |
uses: ./.github/workflows/get_nexus_version_latest.yml | |
build_deploy_to_registry: | |
runs-on: ubuntu-latest | |
needs: get_latest_version | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Enable docker cache to speed-up builds | |
- name: Setup Docker build cache | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/buildx-cache | |
key: ${{runner.os}}-buildx-${{github.sha}} | |
restore-keys: | | |
${{runner.os}}-buildx- | |
# Enable multi-architecture support on build node | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: latest | |
- name: Docker login | |
uses: docker/login-action@v3 | |
with: | |
username: ${{secrets.REGISTRY_USERNAME}} | |
password: ${{secrets.REGISTRY_PASSWORD}} | |
- name: Build + Push image ("development") | |
env: | |
NEXUS_VERSION: ${{needs.get_latest_version.outputs.nexus_version}} | |
run: | | |
docker buildx build \ | |
--build-arg "NEXUS_VERSION=${NEXUS_VERSION}" \ | |
--cache-from type=local,src=/tmp/buildx-cache \ | |
--cache-to type=local,dest=/tmp/buildx-cache \ | |
--label org.opencontainers.image.revision="${{github.sha}}" \ | |
--label org.opencontainers.image.version="${NEXUS_VERSION}" \ | |
--platform "linux/arm/v7,linux/arm64" \ | |
--pull \ | |
--tag "${{secrets.REGISTRY_USERNAME}}/nexus3:development" \ | |
--output "type=image,push=true" \ | |
--file ./Dockerfile . |