mirror of
https://github.com/MrUnknownDE/unknownbin.git
synced 2026-04-10 18:23:45 +02:00
feat: Add Docker and GitHub Actions for CI/CD
This commit is contained in:
40
.github/workflows/docker-publish.yml
vendored
Normal file
40
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Publish Docker Image to GitHub Packages
|
||||
|
||||
# Run this workflow on every push to the main branch
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Grant permissions for the GITHUB_TOKEN to push to the GitHub Container Registry
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to the GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}```
|
||||
Reference in New Issue
Block a user