ReadmeUpdate #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Commit | |
on: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
load: true | |
tags: traveltunes:latest | |
- name: Test Docker image | |
env: | |
SPOTIPY_CLIENT_SECRET: ${{ secrets.SPOTIPY_CLIENT_SECRET }} | |
SPOTIPY_CLIENT_ID: ${{ secrets.SPOTIPY_CLIENT_ID }} | |
SPOTIPY_REDIRECT_URI: ${{ secrets.SPOTIPY_REDIRECT_URI }} | |
SPOTIPY_TOKEN: ${{ secrets.SPOTIPY_TOKEN }} | |
run: | | |
docker run -d -e SPOTIPY_CLIENT_SECRET -e SPOTIPY_CLIENT_ID -e SPOTIPY_REDIRECT_URI -e SPOTIPY_TOKEN -p 5000:5000 traveltunes:latest | |
sleep 5 # Donne un peu de temps au conteneur pour démarrer | |
curl --retry 10 --retry-delay 5 -v http://127.0.0.1:5000/ | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
- name: Test with pytest | |
run: | | |
pytest |