Skip to content

Commit

Permalink
ADD: first cicd draft
Browse files Browse the repository at this point in the history
  • Loading branch information
SzakacsAdam committed Sep 19, 2024
1 parent b99524d commit 1b373fa
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Push Docker Image to GHCR

# Run this workflow on push or pull request to the main branch
on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
# Step 1: Check out the repository code
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Set up Docker Buildx for cross-platform builds (optional but recommended)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Step 3: Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

# Step 4: Build and push the Docker image
- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:latest .
docker push ghcr.io/${{ github.repository }}:latest

0 comments on commit 1b373fa

Please sign in to comment.