Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build prod container image and push to registry

on:
push:
branches:
- main
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
name: Build prod container
permissions:
packages: write
contents: read
env:
REGISTRY: ghcr.io
IMAGE: ghcr.io/chocobocoding/teiserver
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Login to registry
run: buildah login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} $REGISTRY

- name: Build image
run: buildah bud -t $IMAGE:latest .

- name: Push latest image
run: buildah push $IMAGE:latest

- name: Push sha tagged image
run: buildah push $IMAGE:latest $IMAGE:${{ github.sha }}

- name: Push tagged image
if: github.event_name == 'release'
run: buildah push $IMAGE:latest $IMAGE:${{ github.event.release.tag_name }}
Loading