From 8813a9392f135d3df350c696df33d14f9da7d87a Mon Sep 17 00:00:00 2001 From: Clay Smith Date: Sat, 26 Jul 2025 10:34:03 -0700 Subject: [PATCH 1/2] add publish devcontainer workflow --- .github/workflows/publish-devcontainer.yml | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/publish-devcontainer.yml diff --git a/.github/workflows/publish-devcontainer.yml b/.github/workflows/publish-devcontainer.yml new file mode 100644 index 0000000..f4f09b3 --- /dev/null +++ b/.github/workflows/publish-devcontainer.yml @@ -0,0 +1,55 @@ +name: Publish Devcontainer to GHCR + +on: + push: + branches: [main] + paths: + - '.devcontainer/Dockerfile' + - '.github/workflows/publish-devcontainer.yml' + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}/devcontainer + +jobs: + publish-devcontainer: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=sha,prefix={{branch}}- + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push devcontainer image + uses: docker/build-push-action@v6 + with: + context: . + file: .devcontainer/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file From 1b7f11f56ec77da3c56ffc752673938177dfe814 Mon Sep 17 00:00:00 2001 From: Clay Smith Date: Tue, 5 Aug 2025 18:54:07 -0700 Subject: [PATCH 2/2] remove spaces --- .github/workflows/publish-devcontainer.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-devcontainer.yml b/.github/workflows/publish-devcontainer.yml index f4f09b3..08dd53f 100644 --- a/.github/workflows/publish-devcontainer.yml +++ b/.github/workflows/publish-devcontainer.yml @@ -22,17 +22,14 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to Container Registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - + password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata id: meta uses: docker/metadata-action@v5 @@ -41,8 +38,7 @@ jobs: tags: | type=ref,event=branch type=sha,prefix={{branch}}- - type=raw,value=latest,enable={{is_default_branch}} - + type=raw,value=latest,enable={{is_default_branch}} - name: Build and push devcontainer image uses: docker/build-push-action@v6 with: @@ -52,4 +48,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + cache-to: type=gha,mode=max