mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Add workflow
This commit is contained in:
54
containers/.github/workflows/build.yml
vendored
Normal file
54
containers/.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Github Packages
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Waterfall Docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: waterfall
|
||||
tags: ${{ env.REGISTRY }}/${{ IMAGE_NAME }}/waterfall:latest
|
||||
# build on feature branches, push only on main branch
|
||||
push: ${{ github.ref == 'refs/heads/main' }}
|
||||
|
||||
- name: Build and push Paper Docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: paper
|
||||
tags: ${{ env.REGISTRY }}/${{ IMAGE_NAME }}/paper:latest
|
||||
# build on feature branches, push only on main branch
|
||||
push: ${{ github.ref == 'refs/heads/main' }}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user