-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #724 from Levana-Protocol/perp-3443/docker-image-g…
…eneration-for-perps-deploy PERP-3443 | Add github action to generate docker image
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM alpine:3.19.1 | ||
|
||
ADD --chmod=755 https://github.com/fpco/health-check/releases/download/v0.1.0/health-check-x86_64-unknown-linux-musl /usr/bin/health-check | ||
|
||
RUN mkdir -p /app/packages/perps-exes/assets | ||
|
||
USER 1000 | ||
|
||
WORKDIR /app | ||
|
||
COPY --chmod=755 --chown=1000 ./mainnet-factories.toml /app/packages/perps-exes/assets | ||
COPY --chmod=755 --chown=1000 perps-deploy /usr/bin/perps-deploy | ||
|
||
ENTRYPOINT [ "/usr/bin/health-check", "--task-output-timeout", "90000", "--app-description", "Perps Deploy (K8s mainnet)", "perps-deploy" ] | ||
|
||
CMD [ "serve" ] |
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,50 @@ | ||
name: Perps Deploy Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# For cache, run at 9 AM UTC daily | ||
- cron: "0 9 * * *" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_NET_RETRY: 10 | ||
RUST_BACKTRACE: short | ||
RUSTUP_MAX_RETRIES: 10 | ||
|
||
jobs: | ||
perps-deploy-image: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ci-perps-deploy-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: [email protected] | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: 1.75.0 | ||
components: rustfmt, clippy | ||
targets: x86_64-unknown-linux-musl | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: | | ||
. | ||
- name: Dependencies | ||
run: sudo apt install musl-tools -y | ||
- name: Build perps-deploy binary | ||
run: just cargo-perps-deploy-release | ||
- name: Build image | ||
run: just build-perps-deploy-image | ||
- name: Push image | ||
run: just push-perps-deploy-image | ||
if: ${{ github.event_name != 'schedule' }} |
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