name: Docker Image CI Ontime on: push: tags: [ "*" ] workflow_dispatch: jobs: publish_docker: runs-on: ubuntu-latest env: CI: '' steps: - uses: actions/checkout@v4 - name: Setup env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Docker Login uses: docker/login-action@v2.1.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Docker Setup Buildx uses: docker/setup-buildx-action@v2.5.0 - name: Build and push stable release if: github.event.release.prerelease == false uses: docker/build-push-action@v4.0.0 with: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 # Push is a shorthand for --output=type=registry push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/ontime:${{ env.RELEASE_VERSION }} , ${{ secrets.DOCKERHUB_USERNAME }}/ontime:latest - name: Build and push pre-release if: github.event.release.prerelease == true uses: docker/build-push-action@v4.0.0 with: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 # Push is a shorthand for --output=type=registry push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/ontime:${{ env.RELEASE_VERSION }} , ${{ secrets.DOCKERHUB_USERNAME }}/ontime:nightly