1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- ---
- name: docker_image
- on:
- push:
- branches: [ "master" ]
-
- tags: [ "*" ]
- pull_request:
-
- paths:
- - 'lib/**.[ch]'
- - 'lib/**.cpp'
- - 'src/**.[ch]'
- - 'src/**.cpp'
- - 'irr/**.[ch]'
- - 'irr/**.cpp'
- - '**/CMakeLists.txt'
- - 'cmake/Modules/**'
- - 'util/ci/**'
- - 'misc/irrlichtmt_tag.txt'
- - 'Dockerfile'
- - '.dockerignore'
- - '.github/workflows/docker_image.yml'
- workflow_dispatch:
- inputs:
- use_cache:
- description: "Use build cache"
- required: true
- type: boolean
- default: true
- env:
- REGISTRY: ghcr.io
-
- IMAGE_NAME: ${{ github.repository }}
- jobs:
- publish:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- steps:
- - name: Check out repository
- uses: actions/checkout@v4
- - name: Setup Docker buildx
- uses: docker/setup-buildx-action@v3.0.0
-
-
- - name: Log into registry ${{ env.REGISTRY }}
- if: github.event_name != 'pull_request'
- uses: docker/login-action@v3.0.0
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
-
- - name: Extract Docker metadata
- id: meta
- uses: docker/metadata-action@v5.5.0
- with:
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- labels: |
- org.opencontainers.image.title=Luanti
- org.opencontainers.image.vendor=Luanti
- org.opencontainers.image.licenses=LGPL-2.1-only
-
-
-
- - name: Build and push Docker image
- uses: docker/build-push-action@v5.1.0
- with:
- context: .
- platforms: linux/amd64
- push: ${{ github.event_name != 'pull_request' }}
- load: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- cache-from: type=gha
- cache-to: type=gha,mode=max
- no-cache: ${{ (github.event_name == 'workflow_dispatch' && !inputs.use_cache) || startsWith(github.ref, 'refs/tags/') }}
- - name: Test Docker Image
- run: |
- docker run --rm $(cut -d, -f1 <<<"$DOCKER_METADATA_OUTPUT_TAGS") luantiserver --version
- shell: bash
|