adding cicd pipeline to make docker container and publish in registry
Some checks failed
Docker Build and Push / build-and-push (push) Has been cancelled
Some checks failed
Docker Build and Push / build-and-push (push) Has been cancelled
This commit is contained in:
27
.gitea/workflows/docker-build-push.yml
Normal file
27
.gitea/workflows/docker-build-push.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Docker Build and Push
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: docker
|
||||||
|
if: branch == 'main'
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ secrets.REGISTRY_URL }} -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ secrets.REGISTRY_URL }}/FlorianWalther/password-generator:latest .
|
||||||
|
|
||||||
|
- name: Push Docker Image
|
||||||
|
run: |
|
||||||
|
docker push ${{ secrets.REGISTRY_URL }}/FlorianWalther/password-generator:latest
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
run: |
|
||||||
|
docker system prune -f
|
||||||
|
|
||||||
Reference in New Issue
Block a user