name: Build Docker Image for Actions on: [push] jobs: Check-Last-Time: runs-on: ubuntu-22.04 env: DEBIAN_FRONTEND: noninteractive outputs: last-time: ${{ steps.last-time.outputs.last-time }} steps: - name: Install jq run: | apt-get update -y apt-get install -y jq - name: Check last repository build time id: last-time run: curl -s https://hub.docker.com/v2/repositories/drunkendog/standard-build-actions/tags/latest | jq '.last_updated' | xargs -i date --date {} +%s | xargs -i expr $(date +%s) - {} | xargs -i echo last-time={} >> $GITHUB_OUTPUT Build-Image: needs: [Check-Last-Time] if: needs.Check-Last-Time.outputs.last-time > 1 runs-on: ubuntu-22.04 steps: - name: Check out repository code uses: actions/checkout@v3 - name: Get Docker run: curl -sL get.docker.io | bash - name: Build and upload image run: sh actions/build-docker-image.sh ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_TOKEN }}