Merge pull request #81 from kiriharu/main #114
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build docker images | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'Dockerfile' | |
- '.github/workflows/publish_images.yml' | |
env: | |
DOCKER_IMAGE: brammys/necesse-server | |
jobs: | |
build: | |
name: Build ${{matrix.version}} | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
include: | |
- version: 0-26-1 | |
build: 15396124 | |
url: https://necessegame.com/content/server/0-26-1-15396124/necesse-server-linux64-0-26-1-15396124.zip | |
latest: true | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.DOCKER_IMAGE }} | |
tags: | | |
type=raw,value=latest | |
type=raw,value=${{matrix.version}} | |
type=raw,value=${{matrix.version}}-${{matrix.build}} | |
- name: Build and export to Docker hub | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: . | |
file: ./Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
url=${{matrix.url}} | |
version=${{matrix.version}} | |
build=${{matrix.build}} |