Skip to content

Commit

Permalink
Merge pull request space-ros#220 from space-ros/push-dockerhub-main
Browse files Browse the repository at this point in the history
Push main Space ROS images to Dockerhub
  • Loading branch information
eholum authored Sep 26, 2024
2 parents 19a0266 + 6ec90d4 commit 8489033
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/earthly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,26 @@ jobs:
run: |
earthly --ci --output +sources
earthly --ci +image
- name: Push tagged spaceros images to Dockerhub
# Only push to latest if we are building a release
- name: Set latest image tag
id: set_build_tags
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
echo "latest_image_tag=osrf/space-ros:latest" >> $GITHUB_ENV
fi
env:
latest_image_tag: ""
# Push both tagged releases and the latest main builds to Dockerhub
- name: Push spaceros images to Dockerhub
if: ${{ github.ref_type == 'tag' || github.ref_name == 'main' }}
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_RW_TOKEN }}
if: ${{ github.ref_type == 'tag' }}
LATEST_IMAGE_TAG: ${{ env.latest_image_tag }}
run: |
echo $DOCKER_HUB_TOKEN | docker login --username osrfbot --password-stdin
earthly --ci --push +push-image --TAG="osrf/space-ros:${{ github.ref_name }}" --LATEST="osrf/space-ros:latest"
earthly --ci --push +push-image --TAG="osrf/space-ros:${{ github.ref_name }}" --LATEST="$LATEST_IMAGE_TAG"
# Only push the main builds to GHCR
- name: Push the main spaceros image to GHCR
if: ${{ github.ref_name == 'main' }}
run: |
earthly --ci --push +push-image --TAG="ghcr.io/space-ros/space-ros:main" --LATEST=""
earthly --ci --push +push-image --TAG="ghcr.io/space-ros/space-ros:${{ github.ref_name }}" --LATEST=""

0 comments on commit 8489033

Please sign in to comment.