Skip to content

Add docker image build workflow #1

Add docker image build workflow

Add docker image build workflow #1

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ docker/* ]
jobs:
login:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Branch Name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/docker/})" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Docker image
run: |
docker build . -t ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}
docker push ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}