Skip to content

Build and Publish Ubuntu Image #16

Build and Publish Ubuntu Image

Build and Publish Ubuntu Image #16

name: Build and Publish Ubuntu Image
on:
push:
branches: [ "main" ]
paths:
- configs/Ubuntu/Dockerfile
workflow_dispatch:
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
ubuntu-image-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker image build -f configs/Ubuntu/Dockerfile -t docker.io/kbdharun/kasm-dev-ubuntu:latest .
- name: Push to DockerHub
run: |
echo -n ${{ secrets.DOCKER_TOKEN }} | docker login docker.io -u kbdharun --password-stdin
docker image push "docker.io/kbdharun/kasm-dev-ubuntu:latest"
- uses: sigstore/cosign-installer@v3.4.0
- name: Sign container image
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY docker.io/kbdharun/kasm-dev-ubuntu:latest
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
ubuntu-image-ghcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker image build -f configs/Ubuntu/Dockerfile -t ghcr.io/kbdharun/kasm-dev-ubuntu:latest .
- name: Push to GHCR
run: |
echo -n ${{ env.REGISTRY_PASSWORD }} | docker login ghcr.io -u ${{ env.REGISTRY_USER }} --password-stdin
docker image push "ghcr.io/kbdharun/kasm-dev-ubuntu:latest"
- uses: sigstore/cosign-installer@v3.4.0
- name: Sign container image
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY ghcr.io/kbdharun/kasm-dev-ubuntu:latest
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
ubuntu-image-quay:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker image build -f configs/Ubuntu/Dockerfile -t quay.io/kbdharun/kasm-dev-ubuntu:latest .
- name: Push to Quay
run: |
echo -n ${{ secrets.QUAY_TOKEN }} | docker login quay.io -u ${{ secrets.QUAY_USER }} --password-stdin
docker image push "quay.io/kbdharun/kasm-dev-ubuntu:latest"
- uses: sigstore/cosign-installer@v3.4.0
- name: Sign container image
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY quay.io/kbdharun/kasm-dev-ubuntu:latest
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}