Skip to content

Discord/GitHub account linking #781

Discord/GitHub account linking

Discord/GitHub account linking #781

Workflow file for this run

name: Create Docker image
on:
push:
branches: ['main']
tags: ["*"]
pull_request:
branches: ['main']
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
strategy:
matrix:
service:
- name: GameServer
dockerfile: Dockerfile
container_id: refresh
- name: HttpsProxy
dockerfile: HttpsProxy.Dockerfile
container_id: refresh-httpsproxy
- name: PresenceServer
dockerfile: PresenceServer.Dockerfile
container_id: refresh-presenceserver
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step below will fill in things like name, description, etc. from the repository.
# It's helpful for us because it also fills in the version information automatically depending on how the job was invoked.
# See https://github.com/docker/metadata-action#basic
- name: Extract metadata for ${{ matrix.service.name }}
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.service.container_id }}
- name: Build and push ${{ matrix.service.name }}
uses: docker/build-push-action@v6.7.0
with:
context: .
file: ${{ matrix.service.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}