Skip to content

Commit

Permalink
Automatically publish Docker images on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed Apr 20, 2023
1 parent 528e7a3 commit 6441714
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Docker images for Blue Nebula server

on:
push:
tags:
- "*"
branches:
- "*"
pull_request:
branches:
- master

jobs:
build-and-push:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3

- name: Fetch relevant submodules
run: |
git submodule update --init src/enet
git submodule update --init data/maps
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/blue-nebula/server
tags: |
type=semver,pattern={{version}},event=tag
type=ref,event=branch
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
# enable arm64 once native runners are available
#platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 6441714

Please sign in to comment.