Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
RishikesavanRamesh authored May 13, 2024
1 parent cd9d079 commit 9cebcba
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ jobs:
- name: Set Docker repository name
id: set_docker_repo_name
run: echo "docker_repo_name=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_STATE

- name: Generate timestamp
id: timestamp
run: echo "timestamp=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_STATE

- name: Build Docker image
run: docker build -t "${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.set_docker_repo_name.outputs.docker_repo_name }}:latest" -t "${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.set_docker_repo_name.outputs.docker_repo_name }}:$(date +"%Y%m%d%H%M%S")" .devcontainer/ros2/.
run: docker build -t "${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.set_docker_repo_name.outputs.docker_repo_name }}:latest" -t "${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.set_docker_repo_name.outputs.docker_repo_name }}:${{ steps.timestamp.outputs.timestamp }}" .devcontainer/ros2/.

- name: Push Docker image
run: |
docker push "${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.set_docker_repo_name.outputs.docker_repo_name }}:latest"
docker push "${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.set_docker_repo_name.outputs.docker_repo_name }}:$(date +"%Y%m%d%H%M%S")"
docker push "${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.set_docker_repo_name.outputs.docker_repo_name }}:${{ steps.timestamp.outputs.timestamp }}"

0 comments on commit 9cebcba

Please sign in to comment.