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..fd83754 --- /dev/null +++ b/.github/workflows/csgo-pr-workflow.yml @@ -0,0 +1,61 @@ +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" +# - version: "1.11" +# - version: "1.12" + steps: + - 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 + + - 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 + + - 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 }} 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