Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

コンテナイメージのビルド & 保管をGitHub Container Registryにする #77

Merged
merged 14 commits into from
Apr 9, 2023

Conversation

Laica-Lunasys
Copy link
Member

What

  • DockerイメージのビルドをGitHub Actionsにした
  • GitHub Container RegistryにPushするようにもした

Why

  • Misskey.io で使ってるDocker Hubはオーナーしか見れないのでビルドステータスとかがわからない
  • Docker Hubが微妙

Additional info (optional)

  • ビルドできること
  • キャッシュされてること

@Laica-Lunasys Laica-Lunasys changed the title コンテナイメージのビルド & 保管をGitHub Container Registryにする [WIP] コンテナイメージのビルド & 保管をGitHub Container Registryにする Apr 9, 2023
@Laica-Lunasys Laica-Lunasys changed the title [WIP] コンテナイメージのビルド & 保管をGitHub Container Registryにする コンテナイメージのビルド & 保管をGitHub Container Registryにする Apr 9, 2023
Copy link
Member Author

@Laica-Lunasys Laica-Lunasys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

セルフレビューした

Comment on lines +34 to +36
- name: Prepare image tags
run: |
echo "FORMATTED_BRANCH_NAME=$(echo ${{ github.ref_name }} | sed -e 's/\//-/g' )" >> $GITHUB_ENV
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

イメージタグにブランチ名を使うようにしてる。
んだけど、イメージタグには / が使えないので - に置き換えておく
(ブランチ名に / を使うなという話でもある)

Comment on lines +49 to +50
ghcr.io/misskeyio/misskey:latest
ghcr.io/misskeyio/misskey:${{ env.FORMATTED_BRANCH_NAME }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest と一緒にブランチ名をタグ付けしておく (ブランチ名 or タグ付けしていればタグ名)

jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-22.04
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest を使うとlatestで使用されるバージョンが変わると厄介するかもしれないので。

@riku6460 riku6460 self-requested a review April 9, 2023 10:50
@riku6460 riku6460 merged commit b690753 into io Apr 9, 2023
@riku6460 riku6460 deleted the migrate/github-actions branch April 9, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants