Skip to content

Commit

Permalink
feat: add githib workflows and improved Dockerfile with github tokens (
Browse files Browse the repository at this point in the history
…#16)

* feat: add githib workflows and improved Dockerfile with github tokens

* fix: registry command

* fix: image_name

* fix: repo name
  • Loading branch information
Ninjagod1251 authored Oct 24, 2023
1 parent d51761e commit aa76ba7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ uvicorn[standard]
eth-ape
vyper
ape-vyper
python-multipart
python-multipart
vvm>=0.2

0 comments on commit aa76ba7

Please sign in to comment.