-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added job for pushing image to dockerhub repo.
- Loading branch information
Fjodor van Rijsselberg
authored and
Fjodor van Rijsselberg
committed
Dec 14, 2022
1 parent
b24a103
commit 4cb696f
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
# | ||
# test: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# python-version: ["3.9.14"] | ||
# name: Run tests | ||
# steps: | ||
# - name: Checkout repo | ||
# uses: actions/checkout@v3 | ||
# - name: Set python version | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.9.14' | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install pytest | ||
# pip install poetry | ||
# poetry config virtualenvs.create false | ||
# poetry install | ||
# - name: Perform gruesome hack | ||
# run: | | ||
# cp -r pyproject.toml src/stub.toml | ||
# cp -r pyproject.toml src/tests/stub.toml | ||
# - name: Run Pytest | ||
# run: | | ||
# cd src/ | ||
# pytest | ||
push: | ||
name: Push to registry. | ||
runs-on: ubuntu-latest | ||
# needs: test | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Set python version | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9.14' | ||
- name: Perform gruesome hack | ||
run: | | ||
cp -r pyproject.toml src/stub.toml | ||
- name: Get version and tag image | ||
run: | | ||
pip install tomli | ||
cd src/ | ||
echo "version=`python version.py`" >> $GITHUB_ENV | ||
- name: Login to registry | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_PASSWORD }} | ||
- name: Push to dockerhub | ||
run: | | ||
docker build . --file Dockerfile --tag fjodorvr/dataverse-metadata-fetcher:${{ env.version }} | ||
docker push fjodorvr/dataverse-metadata-fetcher:${{ env.version }} |