Add GitHub Actions workflow for pushing Docker images

This commit is contained in:
Andrey Danilov
2024-05-20 22:38:30 +03:00
parent 9e27f642fb
commit 44361a6c37

33
.github/workflows/docker-push.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Push Docker image to GitHub Container Registry
on:
push:
tags:
- '*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets._GITHUB_PAT }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest