diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml new file mode 100644 index 0000000..03133b1 --- /dev/null +++ b/.github/workflows/cicd.yaml @@ -0,0 +1,32 @@ +name: CI/CD +on: + push: + branches: + - main + + pull_request: + +jobs: + docker-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build Image + id: build-image + env: + REGISTRY: ghcr.io + REPOSITORY: apeworx/hosted-compiler + # NOTE: Our image tagging scheme is to tag all builds on "main" with "latest", + # and then when publishing to tag it with the release version tag + "stable" + IMAGE_TAG: latest + run: | + docker build \ + -t $REGISTRY/$REPOSITORY:$IMAGE_TAG \ + . + echo "image=$REGISTRY/$REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT + + - name: Publish Image + # Skip on PRs + if: github.event_name != 'pull_request' + run: docker push ${{ steps.build-image.outputs.image }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 16da660..717732f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,8 @@ FROM apeworx/ape:latest COPY --chown=harambe:harambe . /home/harambe/project RUN pip install -r requirements.txt -ENV GITHUB_TOKEN= +ARG GITHUB_TOKEN +ENV GITHUB_TOKEN=${GITHUB_TOKEN} RUN python3 vvm_versions.py ENV PATH="/home/harambe/.local/bin:${PATH}" ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--reload"] diff --git a/requirements.txt b/requirements.txt index bc6a114..05dacba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ uvicorn[standard] eth-ape vyper ape-vyper -python-multipart \ No newline at end of file +python-multipart +vvm>=0.2 \ No newline at end of file