Return driver object only when valid (#93) #109
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: Build and Deploy containers | |
on: | |
# Always test on pull request | |
pull_request: [] | |
# Deploy on merge to main | |
push: | |
branches: | |
- master | |
jobs: | |
deploy-test-containers: | |
runs-on: ubuntu-latest | |
name: Build Container | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
docker build -t ghcr.io/urlstechie/urlchecker . | |
DOCKER_TAG=$(docker run ghcr.io/urlstechie/urlchecker --version) | |
printf "Docker Tag is ${DOCKER_TAG}\n" | |
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV | |
- name: Login and Deploy Test Container | |
if: (github.event_name != 'pull_request') | |
run: | | |
docker images | |
printf "Docker Tag is ${DOCKER_TAG}\n" | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin | |
docker tag ghcr.io/urlstechie/urlchecker:latest "ghcr.io/urlstechie/urlchecker:${DOCKER_TAG}" | |
docker push ghcr.io/urlstechie/urlchecker:latest | |
docker push "ghcr.io/urlstechie/urlchecker:${DOCKER_TAG}" |