diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2af4cb0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,47 @@ + +name: Build image + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + workflow_dispatch: + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Login to Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install pipenv + run: | + python -m pip install --upgrade pip + pip install pipenv + pipenv --python python + pipenv lock --requirements > build-requirements.txt + + + - name: Push to GitHub Packages + uses: docker/build-push-action@v2 + with: + context: . + file: build/Containerfile + push: true + tags: | + ghcr.io/${{ github.repository }}:build + ghcr.io/${{ github.repository }}:latest