Skip to content

Merge pull request #7 from ItsAlexIK/pr-6 #3

Merge pull request #7 from ItsAlexIK/pr-6

Merge pull request #7 from ItsAlexIK/pr-6 #3

name: Build and Publish Docker Image
on:
push:
branches:
- main
paths:
- Dockerfile
- package.json
- package-lock.json
- src/**
- assets/**
- '**/*.js'
workflow_dispatch: {}
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# 1. Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# 2. Log in to GitHub Container Registry (GHCR)
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
# 3. Build Docker image
- name: Build Docker image
run: |
docker build -t ghcr.io/itsalexik/corewatch:latest .
# 4. Push Docker image to GHCR
- name: Push Docker image
run: |
docker push ghcr.io/itsalexik/corewatch:latest