Skip to content

Commit

Permalink
add workflow to push to harbor
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschonti committed Aug 14, 2024
1 parent 223293b commit 4b6f698
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Push Docker Image

on:
push:
branches:
- master
pull_request:
branches: ['master']

jobs:
build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Registry
run: echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | docker login -u ${{ secrets.DOCKER_REGISTRY_USERNAME }} --password-stdin ${{ secrets.DOCKER_REGISTRY_URL }}

- name: Build and Push Docker Image
run: |
docker buildx create --use
docker buildx inspect --bootstrap
docker buildx build --platform linux/amd64 --push -t ${{ secrets.DOCKER_REGISTRY_URL }}/konzisite-api:latest -f ./Dockerfile .
- name: Logout from Docker Registry
run: docker logout ${{ secrets.DOCKER_REGISTRY_URL }}

0 comments on commit 4b6f698

Please sign in to comment.