Spaces:
Runtime error
Runtime error
name: Unit tests, Docker build, Deploy To HF spaces | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
test-and-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Run tests | |
run: docker-compose up tests | |
- name: Build Docker image | |
if: success() | |
run: docker build -t macrdel/sentiment-summarize-youtube-comments-backend:latest . | |
- name: Push Docker image | |
if: success() | |
run: docker push macrdel/sentiment-summarize-youtube-comments-backend:latest | |
sync-to-hub: | |
runs-on: ubuntu-latest | |
needs: test-and-build | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Deploy to Hugging Face Spaces | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: git push --force https://macrdel:$HF_TOKEN@huggingface.co/spaces/macrdel/sentiment-summarize-youtube-comms master:main | |