From a8c7cfeb1abb65e2bd45c2925bb46df08ec581c3 Mon Sep 17 00:00:00 2001 From: marco79cgn Date: Mon, 2 Dec 2024 22:33:35 +0100 Subject: [PATCH 1/2] Create docker-image.yml to build and deploy container --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..83c7a4b --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag ghcr.io/marco79cgn/audio2tonie:latest From 16510715b4a2d0a65db4df75d4c350cb6344cc73 Mon Sep 17 00:00:00 2001 From: marco79cgn Date: Mon, 2 Dec 2024 22:51:47 +0100 Subject: [PATCH 2/2] push container to registry --- .github/workflows/docker-image.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 83c7a4b..02b111d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -14,5 +14,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag ghcr.io/marco79cgn/audio2tonie:latest + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push Docker Image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: | + ghcr.io/marco79cgn/audio2tonie:latest