From 15098e40ffd0f871554cf350ba2e84f4902e7ac2 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 22:58:46 +0300 Subject: [PATCH 1/7] Add recommented VSCode extensions --- .vscode/extensions.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..cb99a89 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ms-azuretools.vscode-docker" + ] +} \ No newline at end of file From 4aecff7cfae057532b5a8a8b9e08c478d05cc6d4 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 22:58:59 +0300 Subject: [PATCH 2/7] Add VSCode tasks --- .vscode/tasks.json | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .vscode/tasks.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..291f6b6 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,40 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build HLDS Image", + "type": "docker-build", + "dockerBuild": { + "context": "${workspaceFolder}", + "buildArgs": { + "APPBRANCH": "${input:betaBranch}" + }, + "tag": "hlds_image" + }, + "group": { + "kind": "build", + "isDefault": true + }, + }, + { + "type": "shell", + "label": "Run HLDS container", + "command": "docker run --rm -ti -p 27016:27016/udp hlds_image", + "dependsOn": [ + "Build HLDS Image" + ], + } + ], + "inputs": [ + { + "type": "pickString", + "id": "betaBranch", + "default": "true", + "description": "Select DepotsDownloader branch.", + "options": [ + "public", + "steam_legacy", + ] + } + ] +} \ No newline at end of file From 701bead5b0ff7d69919d9175f6d8bab7b8cb2847 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 22:59:26 +0300 Subject: [PATCH 3/7] Add ignore `.vscode/**` path for CI --- .github/workflows/CI.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1be5827..29b15fb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,8 +3,9 @@ name: Docker Image CI on: push: branches: [ master ] - paths-ignore: - - "**.md" + paths-ignore: + - '**.md' + - ".vscode/**" pull_request: workflow_dispatch: schedule: From 6c99b196e88b846694273eeb79c017ee1ba80ae4 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 22:59:43 +0300 Subject: [PATCH 4/7] Add Cache Docker layers --- .github/workflows/CI.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 29b15fb..0bcd7e0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,6 +34,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.2.0 + - name: Cache Docker layers + uses: actions/cache@v4.0.2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Log in to Docker Hub if: github.ref == 'refs/heads/master' uses: docker/login-action@v3.1.0 @@ -50,4 +58,6 @@ jobs: platforms: ${{ env.DOCKER_PLATFORMS }} push: true tags: ${{ env.DOCKER_IMAGE }}:${{ matrix.branch }} - build-args: ${{ matrix.build-args }} \ No newline at end of file + build-args: ${{ matrix.build-args }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file From 9213d5167f71dc9b2c36cc578dfe2799b847a379 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 23:08:19 +0300 Subject: [PATCH 5/7] fix build ci --- .github/workflows/CI.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0bcd7e0..fa19c53 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,13 +50,12 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push Docker image - if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v5.3.0 with: context: . file: ./Dockerfile platforms: ${{ env.DOCKER_PLATFORMS }} - push: true + push: ${{ github.ref == 'refs/heads/master' }} tags: ${{ env.DOCKER_IMAGE }}:${{ matrix.branch }} build-args: ${{ matrix.build-args }} cache-from: type=local,src=/tmp/.buildx-cache From bd6b5a28fb6483479ded186fdada4a22f1b19c07 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 23:16:46 +0300 Subject: [PATCH 6/7] resolve codecheck --- .vscode/tasks.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 291f6b6..d63d565 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -14,7 +14,7 @@ "group": { "kind": "build", "isDefault": true - }, + } }, { "type": "shell", @@ -22,7 +22,7 @@ "command": "docker run --rm -ti -p 27016:27016/udp hlds_image", "dependsOn": [ "Build HLDS Image" - ], + ] } ], "inputs": [ From a3d9be98fdc9f3dd2b0e8995ed26b4a4ed0145f9 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Sun, 31 Mar 2024 23:18:54 +0300 Subject: [PATCH 7/7] resolve codecheck --- .vscode/tasks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d63d565..7e5353f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -33,7 +33,7 @@ "description": "Select DepotsDownloader branch.", "options": [ "public", - "steam_legacy", + "steam_legacy" ] } ]