Skip to content

Commit

Permalink
Merge pull request #944 from tsg-ut/codespaces-image-build
Browse files Browse the repository at this point in the history
devcontainer: Dockerイメージを事前ビルドしCodespacesの起動を高速化
  • Loading branch information
hakatashi authored Oct 10, 2024
2 parents 0d997f9 + 232b397 commit 980d40e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
slackbot:
build: slackbot
# build: slackbot
image: ghcr.io/tsg-ut/slackbot-codespaces-image-slackbot:master
volumes:
- ..:/code
- /code/node_modules
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/codespaces-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create and publish a Codespaces Docker image

on:
push:
branches:
- master

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

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

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Build and push Docker image (slackbot)
id: push_slackbot
uses: docker/build-push-action@v6
with:
context: .devcontainer/slackbot
push: true
tags: ghcr.io/tsg-ut/slackbot-codespaces-image-slackbot:master

- name: Generate artifact attestation (slackbot)
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/tsg-ut/slackbot-codespaces-image-slackbot
subject-digest: ${{ steps.push_slackbot.outputs.digest }}
push-to-registry: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# slackbot

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=false&ref=master&repo=105612722&skip_quickstart=false)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/tsg-ut/slackbot?quickstart=1)

[![Test][action-image]][action-url]
[![Coverage Status][codecov-image]][codecov-url]
Expand Down

0 comments on commit 980d40e

Please sign in to comment.