From 896363373ee754e7baad5879c8024bdf66eb38c0 Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Wed, 12 Feb 2025 19:34:18 +0100 Subject: [PATCH 1/2] Create docker-image.yml --- .github/workflows/docker-image.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 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..2684de5 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,33 @@ +on: + push: + branches: [master] + pull_request: + branches: [master] + +name: "CI" + +jobs: + docker: + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - uses: actions/checkout@v3 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + if: ${{ github.ref == 'refs/heads/master' }} + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./backend + file: ./backend/Dockerfile + push: ${{ github.ref == 'refs/heads/master' }} + tags: ghcr.io/cthit/eatit:latest From 346871735e8f230002fd01275b7385fa399d2aaf Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Wed, 12 Feb 2025 19:35:39 +0100 Subject: [PATCH 2/2] Update docker-image.yml --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2684de5..b3a0289 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -27,7 +27,7 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - context: ./backend - file: ./backend/Dockerfile + context: ./ + file: ./Dockerfile push: ${{ github.ref == 'refs/heads/master' }} tags: ghcr.io/cthit/eatit:latest