name: Docker Image CI on: push: branches: [ "main" ] jobs: build: runs-on: ubuntu-latest permissions: packages: write contents: read steps: - uses: actions/checkout@v3 - name: Build the Docker image run: docker build . --file Dockerfile --tag nvim:latest - name: Log in to registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin - name: Push image run: | IMAGE_NAME="nvim" IMAGE_ID=ghcr.io/szwendacz99/$IMAGE_NAME TAG=$(date +"%Y-%m-%dT%H-%M") docker tag $IMAGE_NAME:latest $IMAGE_ID:$TAG docker push $IMAGE_ID:$TAG