Update to CTF_USERNAME #28
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 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 }} | |
tags: | | |
${{ secrets.REGISTRY_LOGIN_SERVER }}/ssh_server:${{ github.sha }} | |
${{ secrets.REGISTRY_LOGIN_SERVER }}/ssh_server:latest | |
context: "{{defaultContext}}:SSH_Server" | |
file: Dockerfile | |