diff --git a/.github/workflows/docker-publish.yaml b/.github/workflows/docker-publish.yaml index 299a8c727..c8eb202e8 100644 --- a/.github/workflows/docker-publish.yaml +++ b/.github/workflows/docker-publish.yaml @@ -5,7 +5,6 @@ on: push: env: - REGISTRY_IMAGE: ghcr.io/${{ github.repository }} # Only push images on forks or the main branch PUSH_IMAGE: ${{ (github.ref_name == 'master') || (github.repository_owner != 'moos-ivp') }} @@ -13,21 +12,30 @@ jobs: prepare: runs-on: ubuntu-latest outputs: - commit_time: ${{ steps.prepare.outputs.commit_time }} + commit_time: ${{ steps.prepare.outputs.COMMIT_TIMESTAMP }} + registry_image: ${{ steps.prepare.outputs.REGISTRY_IMAGE }} steps: - name: Checkout code uses: actions/checkout@v2 - - name: Prepare commit timestamp + - name: Prepare various metadata id: prepare run: | + # Get the commit timestamp export "COMMIT_TIMESTAMP=$(git log -1 --pretty=%ct)" - echo "COMMIT_TIMESTAMP = $COMMIT_TIMESTAMP" - echo $COMMIT_TIMESTAMP >> $GITHUB_OUTPUT + echo "COMMIT_TIMESTAMP=$COMMIT_TIMESTAMP" | tee $GITHUB_OUTPUT + + # Lowercase the repository name + UNSANITIZED_REGISTRY_IMAGE=ghcr.io/${{ github.repository }} + echo "REGISTRY_IMAGE=${UNSANITIZED_REGISTRY_IMAGE,,}" | tee $GITHUB_OUTPUT + build-minrobot: runs-on: ubuntu-latest + needs: + - prepare env: SOURCE_DATE_EPOCH: ${{ needs.prepare.outputs.commit_time }} + REGISTRY_IMAGE: ${{ needs.prepare.outputs.registry_image }} outputs: # So we can `FROM` this image in the next build digest: ${{ steps.build.outputs.digest }} @@ -76,11 +84,13 @@ jobs: build-gui: runs-on: ubuntu-latest - needs: + needs: + - prepare - build-minrobot env: FLAVOR: "-gui" SOURCE_DATE_EPOCH: ${{ needs.prepare.outputs.commit_time }} + REGISTRY_IMAGE: ${{ needs.prepare.outputs.registry_image }} steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3