Skip to content

Commit

Permalink
add action
Browse files Browse the repository at this point in the history
  • Loading branch information
Salka1988 committed Apr 22, 2024
1 parent 81d3ab1 commit 555f902
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
#name: Build and publish Docker image
#
#on:
# push:
# branches:
# - main
# pull_request:
# types: [opened, synchronize]
# release:
# types: [published]
#
#concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: true
#
#jobs:
# build-and-publish-image:
# runs-on: buildjet-4vcpu-ubuntu-2204
# if: |
# (github.event_name == 'release' && github.event.action == 'published') ||
# github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
# steps:
# - uses: actions/checkout@v3
#
# - name: Build and push Fuel Graph Node Image
# uses: ./.github/actions/docker-publish
# id: publish
# with:
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
# image: ghcr.io/fuellabs/fuel-subgraph
# dockerfile: firehose/Dockerfile
name: Build and publish Docker image

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-and-publish-image:
runs-on: buildjet-4vcpu-ubuntu-2204
if: |
(github.event_name == 'release' && github.event.action == 'published') ||
github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3

- name: Build and push Fuel Graph Node Image
uses: ./.github/actions/docker-publish
id: publish
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
image: ghcr.io/fuellabs/fuel-subgraph
dockerfile: firehose/Dockerfile
8 changes: 4 additions & 4 deletions firehose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ WORKDIR /app

## Planner stage
FROM chef AS planner
COPY ./firehose-extract/ .
COPY ./firehose-extract/ ./firehose-extract/
RUN cargo chef prepare --recipe-path recipe.json

# Extract builder stage
FROM chef AS extract_builder
RUN apt update && apt install -y protobuf-compiler
COPY --from=planner app/recipe.json recipe.json
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY ./firehose-extract/ .
COPY ./firehose-extract/ ./firehose-extract/
RUN cargo build --release

FROM golang:1.22-alpine as go_build
Expand All @@ -32,4 +32,4 @@ COPY ./firehose-core/devel/standard/bootstrap.sh /app/start.sh
RUN chmod +x /app/start.sh

# Additional setup if needed
ENTRYPOINT [ "/app/start.sh" ]
ENTRYPOINT [ "/app/start.sh" ]

0 comments on commit 555f902

Please sign in to comment.