2023-04-09 18:29:06 +09:00
|
|
|
name: Publish Docker image (io)
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2023-04-09 19:12:38 +09:00
|
|
|
- "**"
|
2023-04-09 18:29:06 +09:00
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
push_to_registry:
|
|
|
|
name: Push Docker image to GitHub Container Registry
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
if: github.repository == 'MisskeyIO/misskey'
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-04-09 19:49:38 +09:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2023-04-09 18:29:06 +09:00
|
|
|
with:
|
2023-04-09 18:38:55 +09:00
|
|
|
platforms: linux/amd64
|
2023-04-09 18:29:06 +09:00
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
images: ghcr.io/misskeyio/misskey
|
2023-04-09 18:35:53 +09:00
|
|
|
- name: Log in to GitHub Container Registry
|
2023-04-09 18:29:06 +09:00
|
|
|
uses: docker/login-action@v2
|
|
|
|
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
|
2023-04-09 18:35:53 +09:00
|
|
|
- name: Build and Push to GitHub Container Registry
|
2023-04-09 18:29:06 +09:00
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
platforms: ${{ steps.buildx.outputs.platforms }}
|
|
|
|
provenance: false
|
|
|
|
labels: ${{ env.FORMATTED_BRANCH_NAME }}
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
|
|
|
tags: |
|
|
|
|
ghcr.io/misskeyio/misskey:latest
|
|
|
|
ghcr.io/misskeyio/misskey:${{ env.FORMATTED_BRANCH_NAME }}
|