Fix keep previous backups issue #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |