Skip to content

Commit

Permalink
Added job for pushing image to dockerhub repo.
Browse files Browse the repository at this point in the history
  • 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.
66 changes: 66 additions & 0 deletions .github/workflows/docker-image.yml
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 }}

0 comments on commit 4cb696f

Please sign in to comment.