Skip to content

Commit

Permalink
devcontainer: Build codespaces image and push them in new action
Browse files Browse the repository at this point in the history
  • Loading branch information
hakatashi committed Oct 9, 2024
1 parent 0d997f9 commit fcbf736
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
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
46 changes: 46 additions & 0 deletions .github/workflows/codespaces-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Create and publish Codespaces Docker images

on:
push:
branches:
- master
- codespaces-image-build

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:master
subject-digest: ${{ steps.push_slackbot.outputs.digest }}
push-to-registry: true

0 comments on commit fcbf736

Please sign in to comment.