From af8f51d7a5e68ddb09afa16cbf13dbb1366162b7 Mon Sep 17 00:00:00 2001 From: Chenglim Ear Date: Tue, 2 Jul 2024 15:48:53 -0700 Subject: [PATCH] add explicit check for docker image in order to run jobs that require it --- .github/workflows/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2870ca94..33379c635 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,6 @@ name: "Generate Website Data" on: workflow_dispatch: push: - create: jobs: build: runs-on: ubuntu-latest @@ -19,23 +18,26 @@ jobs: run: | echo ${{github.event_name}} devcontainer=false - noncontainer=true + if docker pull ghcr.io/caciviclab/disclosure-backend-static/${{github.ref_name}}:latest; then + noncontainer=true + else + noncontainer=false + fi for file in ${{ steps.changed-files.outputs.all_changed_files }}; do echo "$file was changed" if [[ ${{github.event_name}} = push ]]; then if [[ $file = .devcontainer* ]]; then devcontainer=true + noncontainer=true elif [[ $file = *requirements.txt* ]]; then devcontainer=true + noncontainer=true elif [[ $file = Gemfile* ]]; then devcontainer=true + noncontainer=true fi fi done - if [[ ${{github.event_name}} = create ]]; then - devcontainer=true - noncontainer=false - fi echo "devcontainer=$devcontainer" >> $GITHUB_OUTPUT echo "noncontainer=$noncontainer" >> $GITHUB_OUTPUT