Skip to content

Commit

Permalink
Add custom image for tf2
Browse files Browse the repository at this point in the history
  • Loading branch information
LordRalex committed Jan 8, 2024
1 parent e071a66 commit 03e4d1a
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build Custom Images
on:
push:
schedule:
- cron: '0 11 * * *'

env:
SWAG_VERSION: "1.16.2"
GO_VERSION: "1.21"
NODE_VERSION: "20"
REGISTRY: docker.com

concurrency:
group: ${{ github.event_name}}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-docker-image-base:
runs-on: ubuntu-20.04
name: "Build Docker images"

strategy:
matrix:
include:
- image: tf2
platform: linux/amd64
file: tf2/Dockerfile

permissions:
contents: read
packages: write

environment: ${{ startsWith(github.ref, 'refs/tags/') && 'Release' || 'Development' }}

env:
REGISTRY: ${{ vars.REGISTRY == 'docker.com' && '' || vars.REGISTRY }}
REGISTRY_USERNAME: ${{ vars.REGISTRY == 'ghcr.io' && github.actor || vars.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ vars.REGISTRY == 'ghcr.io' && secrets.GITHUB_TOKEN || vars.REGISTRY_PASSWORD }}

steps:
- name: Ensure mask
id: values
run: |
echo "::add-mask::$REGISTRY_USERNAME"
echo "::add-mask::$REGISTRY_PASSWORD"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: ${{ env.REGISTRY_USERNAME != '' }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
name=${{ env.REGISTRY != '' && format('{0}/', env.REGISTRY) || '' }}pufferpanel/${{ matrix.image }},enable=${{ env.REGISTRY != '' }}
name=pufferpanel/${{ matrix.image }},enable=${{ env.REGISTRY == '' }}
tags: |
type=ref,prefix=branch-,event=branch
type=schedule,pattern={{date 'YYYYMMDD-hhmmss'}}
- name: Check out code
uses: actions/checkout@v3

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.file }}
push: ${{ github.event_name != 'pull_request' && env.REGISTRY_USERNAME != '' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ matrix.platform }}
10 changes: 10 additions & 0 deletions tf2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM steamcmd/steamcmd

ARG aptproxy=""
ENV DEBIAN_FRONTEND=noninteractive

RUN if [ -n "${aptproxy}" ]; then echo "Acquire::http::Proxy \"http://${aptproxy}\";" > /etc/apt/apt.conf.d/00-apt-proxy; fi && \
apt-get update && \
apt-get install -y libtinfo5:i386 libncurses5:i386 libcurl3-gnutls:i386 && \
apt-get clean && \
rm -rf /var/cache/apt/archives
4 changes: 4 additions & 0 deletions tf2/tf2.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
"supportedEnvironments": [
{
"type": "host"
},
{
"type": "docker",
"image": "pufferpanel/tf2"
}
],
"requirements": {
Expand Down

0 comments on commit 03e4d1a

Please sign in to comment.