Skip to content

Changed base image to use the nvidia provided cuda rocky image #4

Changed base image to use the nvidia provided cuda rocky image

Changed base image to use the nvidia provided cuda rocky image #4

name: Build and Push Docker Image
on:
push:
paths:
- 'docker/*'
branches:
- main
- dev
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: get-name
run: |
echo "REPO_NAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV
echo "REPO_OWNER=$(echo ${{ github.repository_owner}} | tr '[:upper:]' '[:lower:]' )" >> $GITHUB_ENV
- name: print-name
run: |
echo "${{ env.REPO_NAME }}"
echo "${{ env.REPO_OWNER }}"
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
docker build \
-t ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:${{ github.sha }} \
-t ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:latest . -f docker/Dockerfile
- name: Push Docker image
run: |
docker push ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:${{ github.sha }} &&
docker push ghcr.io/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}:latest