Skip to content

Commit

Permalink
add explicit check for docker image in order to run jobs that require it
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenglimEar committed Jul 2, 2024
1 parent 35fa76d commit af8f51d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: "Generate Website Data"
on:
workflow_dispatch:
push:
create:
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -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
Expand Down

0 comments on commit af8f51d

Please sign in to comment.