Simple Python Flask web application designed for running in containers for demos
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 lines
2.2 KiB

name: CI Build App
on:
push:
branches: [master]
paths-ignore:
- ".github/**"
pull_request:
env:
IMAGE_REG: ghcr.io
IMAGE_REPO: benc-uk/python-demoapp
jobs:
test:
name: "Tests & Linting"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Test/linting stub"
run: echo "Nothing here 😐"
# - name: "Upload test results"
# uses: actions/upload-artifact@v2
# with:
# name: test-results
# path: ./src/test-results.xml
# - name: "Report on test results"
# uses: ashley-taylor/junit-report-annotations-action@master
# if: always()
# with:
# access-token: ${{ secrets.GITHUB_TOKEN }}
# path: ./src/test-results.xml
# name: Unit test results
build:
name: "Build & Push Image"
needs: test
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Create datestamp image tag" # Nicer than using github runid, I think
run: echo "IMAGE_TAG=$(date +%d-%m-%Y.%H%M)" >> $GITHUB_ENV
- name: "Docker build image"
run: docker build . -t $IMAGE_REG/$IMAGE_REPO:$IMAGE_TAG
- name: "Login to GitHub container registry"
if: github.ref == 'refs/heads/master'
uses: docker/login-action@v1
with:
registry: ${{ env.IMAGE_REG }}
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: "Docker push image to ${{ env.IMAGE_REG }}"
if: github.ref == 'refs/heads/master'
run: docker push $IMAGE_REG/$IMAGE_REPO
- name: "Trigger AKS release pipeline"
if: github.ref == 'refs/heads/master'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: "CD Release - AKS"
token: ${{ secrets.CR_PAT }}
inputs: '{ "IMAGE_TAG": "${{ env.IMAGE_TAG }}" }'
- name: "Trigger Azure web app release pipeline"
if: github.ref == 'refs/heads/master'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: "CD Release - Webapp"
token: ${{ secrets.CR_PAT }}
inputs: '{ "IMAGE_TAG": "${{ env.IMAGE_TAG }}" }'