Files
Civ/containers/.github/workflows/build.yml
AngrySoundTech ea03160ba9 build any branch
2022-06-04 13:10:29 -04:00

103 lines
2.9 KiB
YAML

name: Build
on:
push:
branches:
- '*'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Waterfall - Docker meta
id: waterfall-meta
uses: docker/metadata-action@v3
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@v3
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: Queue - Docker meta
id: queue-meta
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/civmc/civdocker/queue
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: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Packages
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Waterfall Docker image
uses: docker/build-push-action@v2
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@v2
with:
context: paper
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.paper-meta.outputs.tags }}
labels: ${{ steps.paper-meta.outputs.labels }}
- name: Build and push Queue Docker image
uses: docker/build-push-action@v2
with:
context: queue
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.queue-meta.outputs.tags }}
labels: ${{ steps.queue-meta.outputs.labels }}