Build Docker Image daily #1436
This file contains hidden or 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: Build Docker Image daily | |
| on: | |
| workflow_call: | |
| schedule: | |
| - cron: '35 0 * * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: 'main' | |
| fetch-depth: 100 | |
| - run: | | |
| git config --global --add safe.directory /github/workspace | |
| - name: Determine latest version | |
| id: latest_version | |
| uses: flownative/action-git-latest-release@v1 | |
| - run: | | |
| sudo chmod -R ugo+rwX . && shopt -s dotglob && rm -rf * | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ steps.latest_version.outputs.tag }} | |
| fetch-depth: 100 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| flavor: | | |
| latest=true | |
| images: | | |
| flownative/nginx | |
| harbor.flownative.io/docker/nginx | |
| labels: | | |
| org.opencontainers.image.title=Beach Nginx | |
| org.opencontainers.image.description=Docker image providing Nginx for Beach instances | |
| org.opencontainers.image.licenses=MIT | |
| org.opencontainers.image.vendor=Flownative GmbH | |
| org.opencontainers.image.version=${{ steps.latest_version.outputs.version }} | |
| tags: | | |
| type=semver,pattern={{major}},value=${{ steps.latest_version.outputs.version }} | |
| type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest_version.outputs.version }} | |
| type=semver,pattern={{version}},value=${{ steps.latest_version.outputs.version }} | |
| - name: Set up QEMU | |
| id: qemu | |
| uses: docker/setup-qemu-action@v4 | |
| - | |
| name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKER_IO_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }} | |
| - name: Login to Harbor | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: harbor.flownative.io | |
| username: ${{ secrets.HARBOR_DOCKER_USERNAME }} | |
| password: ${{ secrets.HARBOR_DOCKER_PASSWORD }} | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Send mail for Opsgenie heartbeat | |
| uses: dawidd6/action-send-mail@v13 | |
| with: | |
| connection_url: ${{secrets.OPSGENIE_HEARTBEAT_MAIL_CREDENTIALS}} | |
| subject: Github Actions heartbeat ping | |
| to: docker-build-nginx@flownative.heartbeat.eu.opsgenie.net | |
| from: Github Actions <noreply@flownative.com> | |
| body: Build job of ${{github.repository}} completed successfully! |