2024-06-20 01:13:07 +09:00
|
|
|
name: Publish Docker Image
|
2024-03-19 06:39:57 +09:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-06-20 01:13:07 +09:00
|
|
|
- oscar
|
|
|
|
tags:
|
|
|
|
- '**-oscar.*'
|
2024-03-19 06:39:57 +09:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
push_to_registry:
|
|
|
|
name: Push Docker image to GitHub Container Registry
|
|
|
|
runs-on: ubuntu-22.04
|
2024-09-29 20:17:04 +09:00
|
|
|
if: github.repository == 'oscar-surf/misskey'
|
2024-03-19 06:39:57 +09:00
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
with:
|
2024-09-29 20:17:04 +09:00
|
|
|
images: ghcr.io/oscar-surf/misskey
|
2024-03-19 06:39:57 +09:00
|
|
|
- name: Log in to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Prepare image tags
|
|
|
|
run: |
|
|
|
|
echo "FORMATTED_BRANCH_NAME=$(echo ${{ github.ref_name }} | sed -e 's/\//-/g' )" >> $GITHUB_ENV
|
|
|
|
- name: Build and Push to GitHub Container Registry
|
2024-07-13 02:11:48 +09:00
|
|
|
uses: docker/build-push-action@v6
|
2024-03-19 06:39:57 +09:00
|
|
|
with:
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
platforms: ${{ steps.buildx.outputs.platforms }}
|
|
|
|
provenance: false
|
|
|
|
labels: ${{ env.FORMATTED_BRANCH_NAME }}
|
2024-09-29 20:17:04 +09:00
|
|
|
cache-from: type=registry,ref=ghcr.io/oscar-surf/misskey:oscar-buildcache
|
|
|
|
cache-to: type=registry,ref=ghcr.io/oscar-surf/misskey:oscar-buildcache,mode=max
|
2024-03-19 06:39:57 +09:00
|
|
|
tags: |
|
2024-09-29 20:17:04 +09:00
|
|
|
ghcr.io/oscar-surf/misskey:latest
|
|
|
|
ghcr.io/oscar-surf/misskey:${{ env.FORMATTED_BRANCH_NAME }}
|