diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2192c32..f33fa55 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,18 +1,29 @@ -name: Docker Image CI +name: publish basic container on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + release: + types: [published] jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file DatabaseBackupManager/Dockerfile --tag my-image-name:$(date +%s) + - uses: actions/checkout@v3 + + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: "DatabaseBackupManager/Dockerfile" + platforms: linux/amd64 + push: true + tags: | + dim145/backup-manager:latest + dim145/backup-manager:${{ github.ref_name }} +