Skip to content

Add github action workflow and testing it #9

Add github action workflow and testing it

Add github action workflow and testing it #9

Workflow file for this run

name: Docker Build and Push to ACR
on:
push:
branches:
- main
paths:
- 'SSH_Server/**'
- '.github/workflows/ssh_server.yml'
workflow_dispatch:
pull_request:
jobs:
docker_build_push_acr:
name: 'Docker Build and Push to ACR'
runs-on: ubuntu-latest
environment: production
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v4
- name: 'Docker Login'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build the image and push it to ACR
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.REGISTRY_LOGIN_SERVER }}/ssh_server:${{ github.sha }}
context: "{{defaultContext}}:SSH_Server"
file: Dockerfile