Skip to content

Commit

Permalink
add typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
marksie1988 committed Oct 16, 2023
1 parent f2754d6 commit 2b0fb11
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Alpine",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "debugbox:base"
"image": "debugbox:devops"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/docker-publish-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Docker-Typescript

on:
push:
branches: [ "main" ]
paths:
- "typescript/**"
- ".github/workflows/docker-publish-typescript.yml"
workflow_dispatch:

env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

# Login against a Docker registry
# https://github.com/docker/login-action
- name: Log into Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

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

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: |
docker.io/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=typescript
flavor: |
latest=false
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
with:
context: typescript
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION="typescript"
COMMIT_HASH=${GITHUB_SHA::8}
BUILD_DATE=$(git show -s --format=%cI)
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.version=${{ steps.tags.outputs.version }}
org.opencontainers.image.created=${{ steps.tags.outputs.build_date }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
7 changes: 7 additions & 0 deletions typescript/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM totaldebug/debugbox:base

### ---------------
### Package install
### ---------------

RUN npm install --global yarn

0 comments on commit 2b0fb11

Please sign in to comment.