Skip to content

Commit

Permalink
Move chronicles and tester to buildah action
Browse files Browse the repository at this point in the history
  • Loading branch information
penumbra23 committed Jul 3, 2024
1 parent 351d766 commit e78ee32
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 38 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/merge-docker-chronicle.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build Docker chronicle image
on:
pull_request:
push:
paths:
- '.github/workflows/merge-docker-chronicle.yaml'
Expand Down Expand Up @@ -51,24 +52,26 @@ jobs:
steps:
- name: Fetch latest code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
- name: Create target dir
run: mkdir ${{ github.workspace }}/target
- name: Cache Rust deps
uses: actions/cache@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
path: ${{ github.workspace }}/target/${{matrix.profile}}
key: docker-chronicle-${{ hashFiles('Cargo.lock') }}
- name: Build and push
uses: docker/build-push-action@v4
uses: ./.github/actions/buildah-action
with:
image_name: ${{ env.DOCKER_REPO }}-${{ matrix.image }}:${{ needs.set-tags.outputs.commit_hash8 }}
containerfile: ./config/docker/Dockerfile.chronicle-release
context: .
push: true
tags: |
${{ env.DOCKER_REPO }}-${{ matrix.image }}:${{ needs.set-tags.outputs.commit_hash8 }}
${{ env.DOCKER_REPO }}:latest
file: config/docker/Dockerfile.chronicle-release
build-args: |-
volume: ${{ github.workspace }}/target:/build/target
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: docker.io
push: 'true'
build_args: |
VCS_REF=${{ needs.set-tags.outputs.commit_hash8 }}
PROFILE=${{ matrix.profile }}
25 changes: 10 additions & 15 deletions .github/workflows/merge-docker-tester.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build Docker tester image
on:
pull_request:
push:
paths:
- '.github/workflows/merge-docker-tester.yaml'
Expand Down Expand Up @@ -44,15 +45,6 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
Expand All @@ -68,11 +60,14 @@ jobs:
- name: Copy contracts
run: cp -r target/release/tester tester-bin
- name: Build and push
uses: docker/build-push-action@v4
uses: ./.github/actions/buildah-action
with:
image_name: ${{ env.DOCKER_REPO }}:${{ needs.set-tags.outputs.commit_hash8 }}
containerfile: ./config/docker/Dockerfile.tester-release
context: .
push: true
tags: |
${{ env.DOCKER_REPO }}:${{ needs.set-tags.outputs.commit_hash8 }}
${{ env.DOCKER_REPO }}:latest
file: config/docker/Dockerfile.tester-release
volume: ${{ github.workspace }}/target:/build/target
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: docker.io
push: 'true'

14 changes: 7 additions & 7 deletions .github/workflows/merge-docker-timenode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:
- image: prod
profile: production
features: default
# - image: test
# profile: testnet
# features: default
# - image: dev
# profile: testnet
# features: development
- image: test
profile: testnet
features: default
- image: dev
profile: testnet
features: development
steps:
- name: Fetch latest code
uses: actions/checkout@v3
Expand All @@ -57,7 +57,7 @@ jobs:
uses: ./.github/actions/buildah-action
with:
image_name: ${{ env.DOCKER_REPO }}-${{ matrix.image }}:${{ needs.set-tags.outputs.commit_hash8 }}
containerfile: ./config/docker/Dockerfile.release
containerfile: ./config/docker/Dockerfile.timenode-release
context: .
volume: ${{ github.workspace }}/target:/build/target
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
3 changes: 2 additions & 1 deletion config/docker/Dockerfile.chronicle-release
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ WORKDIR /build
COPY . .

RUN CARGO_HTTP_CHECK_REVOKE=false cargo build --profile $PROFILE --locked -p chronicle
RUN mv /build/target/$PROFILE/chronicle /build/chronicle

FROM ubuntu:22.04

Expand All @@ -20,5 +21,5 @@ LABEL description="Multistage Dockerfile for building Analog Chronicle" \
one.analog.image.source="https://github.com/Analog-Labs/timechain" \
one.analog.image.commit="${VCS_REF}"

COPY --from=builder /build/target/$PROFILE/chronicle chronicle
COPY --from=builder /build/chronicle chronicle
ENTRYPOINT ["/chronicle"]
File renamed without changes.

0 comments on commit e78ee32

Please sign in to comment.