mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
tags:
|
|
- 'v*.*.*'
|
|
pull_request:
|
|
branches:
|
|
- 'master'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Waterfall - Docker meta
|
|
id: waterfall-meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
ghcr.io/civmc/civdocker/waterfall
|
|
tags: |
|
|
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Paper - Docker meta
|
|
id: paper-meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
ghcr.io/civmc/civdocker/paper
|
|
tags: |
|
|
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Login to Github Packages
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push Waterfall Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: waterfall
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.waterfall-meta.outputs.tags }}
|
|
labels: ${{ steps.waterfall-meta.outputs.labels }}
|
|
|
|
- name: Build and push Paper Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: paper
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.paper-meta.outputs.tags }}
|
|
labels: ${{ steps.paper-meta.outputs.labels }}
|
|
|
|
|
|
|