From 785032812f1ea7b9b18782f4a0c2fe8423a06cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 07:49:55 +0100 Subject: [PATCH 1/9] Remove tem. backend deployment from actions and add docker context to frontend build --- .gitea/workflows/demo.yaml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 72ee9c8..a6b1972 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -42,33 +42,8 @@ jobs: - name: Build and Push Latest Docker Image id: build-and-push-latest uses: docker/build-push-action@v4 - if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/docker-deployment' }} with: file: frontend/Dockerfile push: true - tags: git.fawkes100.de/timemanager/timemanager-frontend:latest - build-and-push-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Log into registry at Gitea - uses: docker/login-action@v2 - with: - registry: https://git.fawkes100.de - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v3 - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v2 - with: - images: git.fawkes100.de/timemanager/timemanager-backend - - name: Build and Push Latest Docker Image - id: build-and-push-latest - uses: docker/build-push-action@v4 - if: ${{ github.ref == 'refs/heads/master' }} - with: - file: backend/Dockerfile - push: true - tags: git.fawkes100.de/timemanager/timemanager-backend:latest \ No newline at end of file + tags: git.fawkes100.de/timemanager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From afee5680e12c7fa41d39478e01a432b1fd89803d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 07:52:41 +0100 Subject: [PATCH 2/9] Set context of frontend docker build to frontend/. --- .gitea/workflows/demo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index a6b1972..55ea325 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -44,6 +44,7 @@ jobs: uses: docker/build-push-action@v4 if: ${{ github.ref == 'refs/heads/docker-deployment' }} with: + context: frontend/. file: frontend/Dockerfile push: true tags: git.fawkes100.de/timemanager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From cf06f8107b7838f9506a4c9d48730602888045ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 07:56:51 +0100 Subject: [PATCH 3/9] Fix name of image to match case sensitivity --- .gitea/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 55ea325..205f789 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -38,7 +38,7 @@ jobs: id: meta uses: docker/metadata-action@v2 with: - images: git.fawkes100.de/timemanager/timemanager-frontend + images: git.fawkes100.de/TimeManager/timemanager-frontend - name: Build and Push Latest Docker Image id: build-and-push-latest uses: docker/build-push-action@v4 -- 2.34.1 From 523fa972f0b3a69ad428b87c09504401cf427f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 08:11:45 +0100 Subject: [PATCH 4/9] Fix docker tag to match repo name --- .gitea/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 205f789..d4fa683 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -47,4 +47,4 @@ jobs: context: frontend/. file: frontend/Dockerfile push: true - tags: git.fawkes100.de/timemanager/timemanager-frontend:latest \ No newline at end of file + tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From af716718de4b2b7e4cb00c294f637471ab9cf691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 08:15:07 +0100 Subject: [PATCH 5/9] Adapt reponame to lowercase --- .gitea/workflows/demo.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index d4fa683..55ea325 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -38,7 +38,7 @@ jobs: id: meta uses: docker/metadata-action@v2 with: - images: git.fawkes100.de/TimeManager/timemanager-frontend + images: git.fawkes100.de/timemanager/timemanager-frontend - name: Build and Push Latest Docker Image id: build-and-push-latest uses: docker/build-push-action@v4 @@ -47,4 +47,4 @@ jobs: context: frontend/. file: frontend/Dockerfile push: true - tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest \ No newline at end of file + tags: git.fawkes100.de/timemanager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From e4daee49a1939f4a7767ff45e2cbda3142cc341f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 08:31:12 +0100 Subject: [PATCH 6/9] Include repo owner in image name and tag --- .gitea/workflows/demo.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 55ea325..20949ec 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -38,7 +38,7 @@ jobs: id: meta uses: docker/metadata-action@v2 with: - images: git.fawkes100.de/timemanager/timemanager-frontend + images: git.fawkes100.de/sebastian/timemanager/timemanager-frontend - name: Build and Push Latest Docker Image id: build-and-push-latest uses: docker/build-push-action@v4 @@ -47,4 +47,4 @@ jobs: context: frontend/. file: frontend/Dockerfile push: true - tags: git.fawkes100.de/timemanager/timemanager-frontend:latest \ No newline at end of file + tags: git.fawkes100.de/sebastian/timemanager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From 7d63cd19cb5de68b5e1e131269f0e0966c6133ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 08:44:31 +0100 Subject: [PATCH 7/9] Build backend automatic --- .gitea/workflows/demo.yaml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 20949ec..78cd876 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -47,4 +47,30 @@ jobs: context: frontend/. file: frontend/Dockerfile push: true - tags: git.fawkes100.de/sebastian/timemanager/timemanager-frontend:latest \ No newline at end of file + tags: git.fawkes100.de/sebastian/timemanager/timemanager-frontend:latest + build-and-push-backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Log into registry at Gitea + uses: docker/login-action@v2 + with: + registry: https://git.fawkes100.de + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v2 + with: + images: git.fawkes100.de/sebastian/timemanager/timemanager-backend + - name: Build and Push Latest Docker Image + id: build-and-push-latest + uses: docker/build-push-action@v4 + if: ${{ github.ref == 'refs/heads/docker-deployment' }} + with: + context: backend/. + file: backend/Dockerfile + push: true + tags: git.fawkes100.de/sebastian/timemanager/timemanager-backend:latest \ No newline at end of file -- 2.34.1 From e68f8e9432e4bc62015627dbd34d20b25a48e9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 08:52:19 +0100 Subject: [PATCH 8/9] Perform building only on master branch --- .gitea/workflows/demo.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 78cd876..0cb7e4c 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -28,6 +28,7 @@ jobs: - uses: actions/checkout@v2 - name: Log into registry at Gitea uses: docker/login-action@v2 + if: ${{ github.ref == 'refs/heads/master' }} with: registry: https://git.fawkes100.de username: ${{ secrets.REGISTRY_USER }} @@ -37,12 +38,13 @@ jobs: - name: Extract Docker metadata id: meta uses: docker/metadata-action@v2 + if: ${{ github.ref == 'refs/heads/master' }} with: images: git.fawkes100.de/sebastian/timemanager/timemanager-frontend - name: Build and Push Latest Docker Image id: build-and-push-latest uses: docker/build-push-action@v4 - if: ${{ github.ref == 'refs/heads/docker-deployment' }} + if: ${{ github.ref == 'refs/heads/master' }} with: context: frontend/. file: frontend/Dockerfile @@ -54,21 +56,24 @@ jobs: - uses: actions/checkout@v2 - name: Log into registry at Gitea uses: docker/login-action@v2 + if: ${{ github.ref == 'refs/heads/master' }} with: registry: https://git.fawkes100.de username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 + if: ${{ github.ref == 'refs/heads/master' }} - name: Extract Docker metadata id: meta uses: docker/metadata-action@v2 + if: ${{ github.ref == 'refs/heads/master' }} with: images: git.fawkes100.de/sebastian/timemanager/timemanager-backend - name: Build and Push Latest Docker Image id: build-and-push-latest uses: docker/build-push-action@v4 - if: ${{ github.ref == 'refs/heads/docker-deployment' }} + if: ${{ github.ref == 'refs/heads/master' }} with: context: backend/. file: backend/Dockerfile -- 2.34.1 From 8a86241e867a57852f6541c1c0ab24742880fd3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Tue, 14 Nov 2023 08:54:21 +0100 Subject: [PATCH 9/9] Perform building only on master branch (missed one step in building frontend --- .gitea/workflows/demo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 0cb7e4c..4c20a97 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -35,6 +35,7 @@ jobs: password: ${{ secrets.REGISTRY_PASSWORD }} - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 + if: ${{ github.ref == 'refs/heads/master' }} - name: Extract Docker metadata id: meta uses: docker/metadata-action@v2 -- 2.34.1