diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e334ce5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: Build and push the docker image to DockerHub + +on: + push: + branches: + - main + +jobs: + push_to_registry: + name: Push the docker image to DockerHub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Fetch code from Repository API + uses: actions/checkout@v3 + with: + repository: 'USC-InfoLab/w4h-api' + path: '.' + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: uscimsc/w4h:latest