workflow setup #73
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: Check the working of Hashtag Generator | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
- run_build | |
jobs: | |
build: | |
name: Hashtag Generation Inference | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.7' | |
- name: Setup ChromeDriver | |
uses: nanasess/setup-chromedriver@v2 | |
with: | |
chromedriver-version: '88.0.4324.96' | |
- run: | | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional | |
- name: Build Docker Image | |
run: docker build | |
--progress=plain | |
--build-arg INSTAGRAM_USERNAME=${{ secrets.USERNAME }} | |
--build-arg INSTAGRAM_PASSWORD=${{ secrets.PASSWORD }} | |
-t docker-flask-test . | |
- name: Run Container | |
run: | | |
docker run -p 5000:5000 -d --name my_container docker-flask-test | |
docker logs -f my_container | |
- name: Install requests | |
run: pip install requests | |
- name: Run test | |
run: python test.py |