diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 5f250a7..eb9813e 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -1,20 +1,24 @@ -name: Python application - on: push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: + branches: + - main # or your desired branch +jobs: + build_and_push: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Build & Push Image + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Log in to Azure Container Registry + uses: azure/docker-login@v1 + with: + login-server: ${{ secrets.AZURE_REGISTRY_URL }} + username: ${{ secrets.AZURE_REGISTRY_USERNAME }} + password: ${{ secrets.AZURE_REGISTRY_PASSWORD }} + + - name: Build and push Docker image run: | - echo "${{ secrets.DOCKERPW }}" | docker login -u "dab8106" --password-stdin - docker image build -t dab8106/pyflask:latest . - docker push dab8106/pyflask:latest + docker build -t ${{ secrets.AZURE_REGISTRY_URL }}/fahad:${{ github.sha }} . + docker push ${{ secrets.AZURE_REGISTRY_URL }}/fahad:${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index bb9e732..ac790c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,5 @@ RUN pip install -r requirements.txt COPY . . -LABEL maintainer="WebMagic Informatica " \ - version="1.0" CMD flask run --host=0.0.0.0 --port=5000