Skip to content

Add dockerhub repo

Add dockerhub repo #1

name: Build and Publish (tag only)
on:
push:
tags:
- "*" # build on any tag (e.g. v0.1.0, 2026-03-04, etc.)
permissions:
contents: read
env:
IMAGE_NAME: ecomod/code-server
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# enables BuildKit builder features/caching.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta (tag only)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
# Keep it simple: build only amd64 (same arch as GH runners)
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}