Skip to content

Update Dockerfile

Update Dockerfile #107

name: Docker Image CI
on:
push:
branches:
- main
paths:
- '.devcontainer/Dockerfile'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Image version
shell: bash
run: echo "VERSION=$(cat .devcontainer/version.txt)" >> $GITHUB_ENV
- name: Lowercase repository owner
shell: bash
run: echo "LOWERCASE_REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry (GHCR)
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/devcontainer:latest
ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/devcontainer:${{ env.VERSION }}
platforms: linux/amd64
file: .devcontainer/Dockerfile
context: .