From 7a76cbfacf6fa8a8186debb1c827f8d8c59e89a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Budziak?= Date: Sat, 1 Oct 2022 12:22:27 +0200 Subject: [PATCH 1/6] CSGO --- .github/workflows/csgo-master-workflow.yml | 53 ++++++++++++++++++++ .github/workflows/csgo-pr-workflow.yml | 57 ++++++++++++++++++++++ csgo/.gitkeep | 0 csgo/Dockerfile | 4 ++ 4 files changed, 114 insertions(+) create mode 100644 .github/workflows/csgo-master-workflow.yml create mode 100644 .github/workflows/csgo-pr-workflow.yml delete mode 100644 csgo/.gitkeep create mode 100644 csgo/Dockerfile diff --git a/.github/workflows/csgo-master-workflow.yml b/.github/workflows/csgo-master-workflow.yml new file mode 100644 index 0000000..de4e0c7 --- /dev/null +++ b/.github/workflows/csgo-master-workflow.yml @@ -0,0 +1,53 @@ +name: CSGO Master Workflow +on: + push: + branches: + - master + paths: + - csgo/** +jobs: + main: + name: Build and push docker image to Docker Hub + runs-on: ubuntu-latest + strategy: + matrix: + include: + - version: "1.10.0" + build_url: "https://sm.alliedmods.net/smdrop/1.10/sourcemod-1.10.0-git6482-linux.tar.gz" + - version: "1.11.0" + build_url: "https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6911-linux.tar.gz" + - version: "1.12.0" + build_url: "https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git6925-linux.tar.gz" + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Cache csgo + id: cache-csgo + uses: actions/cache@v3 + with: + path: /tmp/csgo + key: csgo + restore-keys: | + csgo + + - name: Build and push to Docker Hub + uses: docker/build-push-action@v2 + with: + context: ./csgo + push: true + tags: budziam/csgo:${{ matrix.version }} + build-args: | + BUILD_URL=${{ matrix.build_url }} diff --git a/.github/workflows/csgo-pr-workflow.yml b/.github/workflows/csgo-pr-workflow.yml new file mode 100644 index 0000000..ab49e3f --- /dev/null +++ b/.github/workflows/csgo-pr-workflow.yml @@ -0,0 +1,57 @@ +name: CS:GO Pull Request Workflow +on: + pull_request: + branches: + - master + paths: + - csgo/** +jobs: + main: + name: Build docker image + runs-on: ubuntu-latest + strategy: + matrix: + include: + - version: "1.10.0" + build_url: "https://sm.alliedmods.net/smdrop/1.10/sourcemod-1.10.0-git6482-linux.tar.gz" +# - version: "1.11.0" +# build_url: "https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6911-linux.tar.gz" +# - version: "1.12.0" +# build_url: "https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git6925-linux.tar.gz" + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Get commit SHA + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Cache csgo + id: cache-csgo + uses: actions/cache@v3 + with: + path: /tmp/csgo + key: csgo + restore-keys: | + csgo + + - name: Build and push to Docker Hub + uses: docker/build-push-action@v2 + with: + context: ./csgo + push: true + tags: budziam/csgo:${{ matrix.version }}-${{ steps.vars.outputs.sha_short }} + build-args: | + BUILD_URL=${{ matrix.build_url }} diff --git a/csgo/.gitkeep b/csgo/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/csgo/Dockerfile b/csgo/Dockerfile new file mode 100644 index 0000000..9c4a5ed --- /dev/null +++ b/csgo/Dockerfile @@ -0,0 +1,4 @@ +FROM steamcmd/steamcmd:ubuntu-20 + +RUN mkdir /tmp/csgo +RUN steamcmd +force_install_dir /tmp/csgo +login anonymous +app_update 740 validate +quit From 0c6df75cecde97d4314d4fe7e4e765b3a61357cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Budziak?= Date: Sat, 1 Oct 2022 17:11:35 +0200 Subject: [PATCH 2/6] More space --- .github/workflows/csgo-pr-workflow.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/csgo-pr-workflow.yml b/.github/workflows/csgo-pr-workflow.yml index ab49e3f..d907f00 100644 --- a/.github/workflows/csgo-pr-workflow.yml +++ b/.github/workflows/csgo-pr-workflow.yml @@ -12,13 +12,17 @@ jobs: strategy: matrix: include: - - version: "1.10.0" - build_url: "https://sm.alliedmods.net/smdrop/1.10/sourcemod-1.10.0-git6482-linux.tar.gz" -# - version: "1.11.0" -# build_url: "https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6911-linux.tar.gz" -# - version: "1.12.0" -# build_url: "https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git6925-linux.tar.gz" + - version: "1.10." +# - version: "1.11" +# - version: "1.12" steps: + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + root-reserve-mb: 512 + swap-size-mb: 1024 + remove-dotnet: 'true' + - name: Check out the repo uses: actions/checkout@v2 @@ -53,5 +57,3 @@ jobs: context: ./csgo push: true tags: budziam/csgo:${{ matrix.version }}-${{ steps.vars.outputs.sha_short }} - build-args: | - BUILD_URL=${{ matrix.build_url }} From 7c9e426d5cf6630c772f44c27b2460756167be99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Budziak?= Date: Sat, 1 Oct 2022 17:13:37 +0200 Subject: [PATCH 3/6] No cache --- .github/workflows/csgo-pr-workflow.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/csgo-pr-workflow.yml b/.github/workflows/csgo-pr-workflow.yml index d907f00..0b02d66 100644 --- a/.github/workflows/csgo-pr-workflow.yml +++ b/.github/workflows/csgo-pr-workflow.yml @@ -42,14 +42,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Cache csgo - id: cache-csgo - uses: actions/cache@v3 - with: - path: /tmp/csgo - key: csgo - restore-keys: | - csgo +# - name: Cache csgo +# id: cache-csgo +# uses: actions/cache@v3 +# with: +# path: /tmp/csgo +# key: csgo - name: Build and push to Docker Hub uses: docker/build-push-action@v2 From f606b54585327e3b5c1a42a4ba74992cbc47b310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Budziak?= Date: Sat, 1 Oct 2022 17:19:08 +0200 Subject: [PATCH 4/6] Again --- .github/workflows/csgo-pr-workflow.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/csgo-pr-workflow.yml b/.github/workflows/csgo-pr-workflow.yml index 0b02d66..49d3ca1 100644 --- a/.github/workflows/csgo-pr-workflow.yml +++ b/.github/workflows/csgo-pr-workflow.yml @@ -16,12 +16,12 @@ jobs: # - version: "1.11" # - version: "1.12" steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - with: - root-reserve-mb: 512 - swap-size-mb: 1024 - remove-dotnet: 'true' +# - name: Maximize build space +# uses: easimon/maximize-build-space@master +# with: +# root-reserve-mb: 512 +# swap-size-mb: 1024 +# remove-dotnet: 'true' - name: Check out the repo uses: actions/checkout@v2 From ae441bd156bfae3f0acce372935d3575535a34d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Budziak?= Date: Sat, 1 Oct 2022 17:28:09 +0200 Subject: [PATCH 5/6] Again --- .github/workflows/csgo-pr-workflow.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/csgo-pr-workflow.yml b/.github/workflows/csgo-pr-workflow.yml index 49d3ca1..f3f7f3f 100644 --- a/.github/workflows/csgo-pr-workflow.yml +++ b/.github/workflows/csgo-pr-workflow.yml @@ -16,12 +16,16 @@ jobs: # - version: "1.11" # - version: "1.12" steps: -# - name: Maximize build space -# uses: easimon/maximize-build-space@master -# with: -# root-reserve-mb: 512 -# swap-size-mb: 1024 -# remove-dotnet: 'true' + - name: Clean up space + shell: bash + run: | + echo "=== Before ===" + df -h / + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + echo "=== After ===" + df -h / - name: Check out the repo uses: actions/checkout@v2 From 827798009358c9b672f39c1ecf0020ee37ced869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Budziak?= Date: Sat, 1 Oct 2022 17:30:32 +0200 Subject: [PATCH 6/6] With cache --- .github/workflows/csgo-pr-workflow.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/csgo-pr-workflow.yml b/.github/workflows/csgo-pr-workflow.yml index f3f7f3f..fd83754 100644 --- a/.github/workflows/csgo-pr-workflow.yml +++ b/.github/workflows/csgo-pr-workflow.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: include: - - version: "1.10." + - version: "1.10" # - version: "1.11" # - version: "1.12" steps: @@ -46,12 +46,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} -# - name: Cache csgo -# id: cache-csgo -# uses: actions/cache@v3 -# with: -# path: /tmp/csgo -# key: csgo + - name: Cache csgo + id: cache-csgo + uses: actions/cache@v3 + with: + path: /tmp/csgo + key: csgo - name: Build and push to Docker Hub uses: docker/build-push-action@v2