Skip to content

Commit

Permalink
add .github/workflows/ket-build-image.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Oct 12, 2024
1 parent a037e94 commit 8368090
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ket-build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: (ket) Publish Docker image to ghcr.io

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+.[0-9]"

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Log in to the Container registry
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: metadata
run: echo "version=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")" >> "$GITHUB_OUTPUT"

- name: Build and push Docker image for mastodon
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/ushitora-anqou/ket-mastodon:${{ steps.metadata.outputs.version }}

- name: Build and push Docker image for mastodon-streaming
uses: docker/build-push-action@v5
with:
context: streaming
push: true
tags: ghcr.io/ushitora-anqou/ket-mastodon-streaming:${{ steps.metadata.outputs.version }}
build-args: |
MASTODON_SOURCE_TAG=${{ steps.metadata.outputs.version }}

0 comments on commit 8368090

Please # to comment.