-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and publish seichiassist-builder docker image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'seichiassist-builder-v2/**' | ||
- '.github/workflows/publish-seichiassist-builder-v2.yml' | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
env: | ||
image_name: seichiassist-builder-v2 | ||
|
||
# 参考: https://qiita.com/kawakawaryuryu/items/b0291c1bc1141a535263 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- id: prepare_image_id | ||
name: Prepare image id's components | ||
run: | | ||
lowercase_id=ghcr.io/${{ github.repository_owner }}/${{ env.image_name }} | ||
echo "::set-output name=lowercase_id::$(echo $lowercase_id | tr '[A-Z]' '[a-z]')" | ||
echo "::set-output name=short-ref::$(git rev-parse --short "$GITHUB_SHA")" | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./seichiassist-builder-v2 | ||
builder: ${{ steps.buildx.outputs.name }} | ||
push: true | ||
tags: | | ||
${{ steps.prepare_image_id.outputs.lowercase_id }}:latest | ||
${{ steps.prepare_image_id.outputs.lowercase_id }}:${{ steps.prepare_image_id.outputs.short-ref }} | ||
cache-from: type=gha | ||
# すべてのビルドステージのすべてのレイヤーをキャッシュして欲しいのでmode=max | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and publish seichiassist-runner docker image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'seichiassist-runner-v2/**' | ||
- '.github/workflows/publish-seichiassist-runner-v2.yml' | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
env: | ||
image_name: seichiassist-runner-v2 | ||
|
||
# 参考: https://qiita.com/kawakawaryuryu/items/b0291c1bc1141a535263 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- id: prepare_image_id | ||
name: Prepare image id's components | ||
run: | | ||
lowercase_id=ghcr.io/${{ github.repository_owner }}/${{ env.image_name }} | ||
echo "::set-output name=lowercase_id::$(echo $lowercase_id | tr '[A-Z]' '[a-z]')" | ||
echo "::set-output name=short-ref::$(git rev-parse --short "$GITHUB_SHA")" | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./seichiassist-runner-v2 | ||
builder: ${{ steps.buildx.outputs.name }} | ||
push: true | ||
tags: | | ||
${{ steps.prepare_image_id.outputs.lowercase_id }}:latest | ||
${{ steps.prepare_image_id.outputs.lowercase_id }}:${{ steps.prepare_image_id.outputs.short-ref }} | ||
cache-from: type=gha | ||
# すべてのビルドステージのすべてのレイヤーをキャッシュして欲しいのでmode=max | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM eclipse-temurin:17.0.7_7-jdk-jammy | ||
|
||
# sbt をインストールする (https://www.scala-sbt.org/1.x/docs/ja/Installing-sbt-on-Linux.html) | ||
RUN apt-get update && apt-get install -y apt-transport-https curl gnupg | ||
|
||
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list | ||
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list | ||
RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" \ | ||
| gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import | ||
RUN chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg | ||
|
||
RUN apt-get update && apt-get install -y sbt=1.9.0 | ||
|
||
# sbt launcherがsbtをDLしてくれる | ||
RUN sbt --version | ||
|
||
# eclipse-temurin にはgitがインストールされておらず、CIの利用には不便 | ||
RUN apt-get install -y git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM eclipse-temurin:17.0.7_7-jdk-jammy | ||
|
||
RUN apt-get update && apt-get install nkf | ||
ADD https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 /usr/bin/yq | ||
RUN chmod +x /usr/bin/yq |