Skip to content

Commit

Permalink
fix(#151): failing build github action
Browse files Browse the repository at this point in the history
  • Loading branch information
njuguna-n authored Sep 13, 2024
1 parent 64da267 commit 452f6f8
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,32 @@ jobs:

- name: Get the latest release tag
id: get_latest_release
uses: actions/github-script@v6
with:
script: |
const latestRelease = await github.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
});
return latestRelease.data.tag_name;
run: |
API_RESPONSE=$(curl -sL https://api.github.com/repos/${{ github.repository }}/releases/latest)
LATEST_TAG=$(echo "$API_RESPONSE" | jq -r .tag_name)
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
LATEST_TAG="latest"
fi
echo "RELEASE_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Build and push couch2pg
uses: docker/build-push-action@v4
with:
context: ./couch2pg
file: ./couch2pg/Dockerfile
push: true
tags: medicmobile/cht-sync-couch2pg:${{ steps.get_latest_release.outputs.result }}
tags: |
medicmobile/cht-sync-couch2pg:${{ steps.get_latest_release.outputs.RELEASE_TAG }}
medicmobile/cht-sync-couch2pg:latest
- name: Build and push dataemon
uses: docker/build-push-action@v4
with:
context: ./dbt
file: ./dbt/Dockerfile
push: true
tags: medicmobile/dataemon:${{ steps.get_latest_release.outputs.result }}
tags: |
medicmobile/dataemon:${{ steps.get_latest_release.outputs.RELEASE_TAG }}
medicmobile/dataemon:latest

0 comments on commit 452f6f8

Please sign in to comment.