Skip to content

Commit

Permalink
Add a wait for response from pypi before building and pushing the doc…
Browse files Browse the repository at this point in the history
…ker image
  • Loading branch information
mbertin authored and nitreb committed Apr 2, 2024
1 parent 331090e commit 28692c5
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,35 @@ jobs:
poetry publish --build --username __token__ --password "${PYPI_TOKEN}"
- name: Set VERSION environment variable
id: set-version
shell: micromamba-shell {0}
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_ENV

- name: Build and publish Docker image
shell: micromamba-shell {0}
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PUSH_TOKEN: ${{ secrets.DOCKER_HUB_PUSH_TOKEN }}
run: make build-and-publish-dockerhub-image
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_OUTPUT

- name: Create tag
shell: micromamba-shell {0}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag v$VERSION
git tag v${{ steps.set-version.outputs.VERSION }}
git push origin --tags
- name: Create Github release
shell: micromamba-shell {0}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create v$VERSION --generate-notes
run: gh release create v${{ steps.set-version.outputs.VERSION }} --generate-notes

- name: Wait for Pypi version to be available
uses: cygnetdigital/[email protected]
with:
url: 'https://pypi.org/project/copernicusmarine/${{ steps.set-version.outputs.VERSION }}/'
responseCode: '200'
timeout: 600000
interval: 5000

- name: Build and publish Docker image
shell: micromamba-shell {0}
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PUSH_TOKEN: ${{ secrets.DOCKER_HUB_PUSH_TOKEN }}
run: make build-and-publish-dockerhub-image

0 comments on commit 28692c5

Please sign in to comment.