From 7a8d0044cf835fb5665f34be476d3e3806bd182e Mon Sep 17 00:00:00 2001 From: SOUMYA BANERJEE <54377824+Soumyaworks@users.noreply.github.com> Date: Thu, 14 Sep 2023 12:48:08 +0530 Subject: [PATCH] Update publish.yml --- .github/workflows/publish.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d657a63..d43068f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,18 +1,20 @@ -name: Docker Image CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - +name: publish +on: [push] jobs: - - build: - + publish-docker-image: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + - uses: actions/checkout@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push the Docker image with a new name + run: | + # Change the image name and tag as needed + IMAGE_NAME="ghcr.io/Soumyaworks/manylinux2014-llvm:12-x86_64" + docker build . --tag $IMAGE_NAME + docker run $IMAGE_NAME + docker push $IMAGE_NAME