Skip to content

Modify build workflow to tag stable images as stable #1

Modify build workflow to tag stable images as stable

Modify build workflow to tag stable images as stable #1

name: Docker Build and Push (Main)
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: stable
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 }}