diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 57c7e0c1..94bfae50 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -1,10 +1,13 @@ name: ci-cd -on: pull_request, push +# run the action on pull_requests and pushes +on: [pull_request, push] jobs: + # first job to test the application using pytest build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # choose the OS for running the action + # define the individual sequential steps to be run steps: - name: Checkout the repository uses: actions/checkout@v2 @@ -18,11 +21,16 @@ jobs: - name: Run pytest run: | pytest - + + # second job to zip the codebase and upload it as an artifact when build succeeds upload_zip: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # choose the OS for running the action needs: build + + # only run this action for pushes if: ${{ github.event_name == 'push' }} + + # define the individual sequential steps to be run steps: - name: Checkout the repository uses: actions/checkout@v2