-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop use Drone instead use Github actions
- Loading branch information
Showing
5 changed files
with
102 additions
and
197 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
name: docker | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
# This is required by aws-actions. | ||
# | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: hadolint/[email protected] | ||
with: | ||
recursive: true | ||
ignore: DL3018 | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
build: | ||
- dockerfile: event-pipeline-evm/Dockerfile | ||
name: event-pipeline-evm | ||
- dockerfile: event-pipeline/Dockerfile | ||
name: event-pipeline | ||
- dockerfile: staking-api/Dockerfile | ||
name: staking-api | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ secrets.AWSROLE }} | ||
aws-region: us-east-1 | ||
- uses: aws-actions/amazon-ecr-login@v1 | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-qemu-action@v2 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/build-push-action@v3 | ||
with: | ||
push: ${{ github.ref == 'ref/heads/master' && 'true' || 'false' }} | ||
context: . | ||
file: ${{ matrix.build.dockerfile }} | ||
platforms: linux/amd64 | ||
tags: ${{ secrets.REGISTRY }}/0x/${{ matrix.build.name }}:${{ github.sha }} |
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,38 +1,50 @@ | ||
# Stage 1 - Build | ||
FROM node:12-alpine as build | ||
# | ||
FROM node:12-alpine AS build | ||
WORKDIR /usr/src/app | ||
|
||
# Install app dependencies | ||
COPY event-pipeline-evm event-pipeline-evm | ||
COPY pipeline-utils pipeline-utils | ||
COPY package.json yarn.lock tsconfig.json lerna.json ./ | ||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --no-cache --virtual build-dependencies bash git openssh python3 make g++ && \ | ||
yarn --frozen-lockfile --no-cache | ||
|
||
RUN yarn build | ||
RUN apk add --update --no-cache --virtual build-dependencies \ | ||
bash \ | ||
git \ | ||
openssh \ | ||
python3 \ | ||
make \ | ||
g++ && \ | ||
yarn --frozen-lockfile --no-cache && \ | ||
yarn build | ||
|
||
# Stage 2 | ||
# | ||
FROM node:12-alpine | ||
WORKDIR /usr/src/app | ||
|
||
# Setup monorepo | ||
# | ||
COPY package.json yarn.lock tsconfig.json lerna.json ./ | ||
|
||
# Setup pipeline-utils | ||
# | ||
COPY pipeline-utils/package.json pipeline-utils/ | ||
COPY --from=build /usr/src/app/pipeline-utils/lib pipeline-utils/lib | ||
|
||
# Install event-pipeline-evm runtime dependencies | ||
# | ||
COPY event-pipeline-evm/package.json event-pipeline-evm/ | ||
RUN apk add git && \ | ||
RUN apk add --update --no-cache git && \ | ||
yarn install --frozen-lockfile --no-cache --production && \ | ||
yarn cache clean && \ | ||
apk del git | ||
|
||
# Copy built files | ||
# | ||
COPY --from=build /usr/src/app/event-pipeline-evm/lib event-pipeline-evm/lib/ | ||
|
||
#Start | ||
# Start | ||
# | ||
WORKDIR /usr/src/app/event-pipeline-evm | ||
CMD [ "yarn", "migrate_and_start" ] |
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
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