Skip to content

edit

edit #79

Workflow file for this run

name: Build and Push Docker image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
IMAGE_NAME="ghcr.io/${{ github.repository }}"
IMAGE_NAME_LC=$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]')
docker build -t ${IMAGE_NAME_LC}:latest ./docker
- name: Push Docker image
run: |
IMAGE_NAME="ghcr.io/${{ github.repository }}"
IMAGE_NAME_LC=$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]')
docker push ${IMAGE_NAME_LC}:latest