Skip to content

Fix keep previous backups issue #9

Fix keep previous backups issue

Fix keep previous backups issue #9

name: Docker Build and Push
on:
push:
branches:
- main
env:
DOCKER_REGISTRY: aminvsf
DOCKER_USERNAME: ${{ secrets.PGBACKUP_REGISTRY_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.PGBACKUP_REGISTRY_PASSWORD }}
DOCKER_IMAGE_NAME: pg-backup
TAG: v${{ github.run_number }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker registry
run: echo "${{ env.DOCKER_PASSWORD }}" | docker login -u ${{ env.DOCKER_USERNAME }} --password-stdin
- name: Build and Push Docker image
run: |
docker build -t ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }} .
docker push ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.TAG }}