-
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.
workflow for build and push image to GHCR
- Loading branch information
1 parent
478f656
commit 5bd3e4d
Showing
2 changed files
with
40 additions
and
34 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 |
---|---|---|
@@ -1,52 +1,36 @@ | ||
name: Build CI Pipeline | ||
name: Build and Push Docker Image to GHCR | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Set up Node.js environment | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
# Install and build the frontend | ||
- name: Install and build frontend | ||
run: | | ||
cd ui/frontend | ||
yarn install | ||
yarn run build | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
# Set up Rust environment | ||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
toolchain: stable | ||
default: true | ||
override: true | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.TOKEN }} | ||
|
||
# Build Rust server | ||
- name: Build Rust server | ||
run: | | ||
cd ui | ||
cargo build --release | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/GITHUB_USERNAME/nullaway-sandbox:latest | ||
|
||
# Build the compiler containers | ||
- name: Build compiler tools | ||
- name: Verify image | ||
run: | | ||
cd compiler | ||
chmod +x build.sh | ||
./build.sh | ||
docker pull ghcr.io/GITHUB_USERNAME/nullaway-sandbox:latest |
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,22 @@ | ||
# Updated Dockerfile | ||
FROM node:14 AS frontend | ||
|
||
WORKDIR /app | ||
|
||
# Copy the repository code (from GitHub Actions checkout) | ||
COPY . /app | ||
|
||
# Build backend | ||
WORKDIR /app/NullAway-Sandbox/compiler | ||
RUN ./build.sh | ||
|
||
# Build frontend | ||
WORKDIR /app/NullAway-Sandbox/ui/frontend | ||
RUN yarn && yarn run watch | ||
|
||
# Build Rust server | ||
WORKDIR /app/NullAway-Sandbox/ui | ||
RUN cargo build --release | ||
|
||
EXPOSE 8000 | ||
CMD ["cargo", "run"] |