Skip to content

Commit

Permalink
test running services
Browse files Browse the repository at this point in the history
  • Loading branch information
sm47916 committed Nov 30, 2023
1 parent 16750e3 commit b195305
Showing 1 changed file with 55 additions and 50 deletions.
105 changes: 55 additions & 50 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
runs-on: ubuntu-latest
name: Ethlance build and test
services:
ganache:
image: trufflesuite/ganache:v7.9.1
options: >-
-v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine", -p 8550, -b 0.5, --chain.allowUnlimitedContractSize=true
# cmd: [-v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine", -p 8550, -b 0.5, --chain.allowUnlimitedContractSize=true]
# ganache:
# image: trufflesuite/ganache:v7.9.1
# options: >-
# -v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine", -p 8550, -b 0.5, --chain.allowUnlimitedContractSize=true
# # cmd: [-v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine", -p 8550, -b 0.5, --chain.allowUnlimitedContractSize=true]
ipfs-daemon:
image: district0x/ipfs-daemon:latest
postgres:
Expand Down Expand Up @@ -58,55 +58,60 @@ jobs:
cp -r ethlance-config/config .
ls -lah config/
docker_build:
strategy:
matrix:
image: ["server", "ui"]
env: ["qa"]
permissions:
contents: read
name: Docker Build
runs-on: ubuntu-latest
steps:
- name: Checkout ethlance code
uses: actions/checkout@v4
- name: Run ganache service
run: |
docker run --rm -d --name ganache trufflesuite/ganache:v7.9.1 -v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine" -p 8550 -b 0.5 --chain.allowUnlimitedContractSize=true
# docker_build:
# strategy:
# matrix:
# image: ["server", "ui"]
# env: ["qa"]
# permissions:
# contents: read
# name: Docker Build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout ethlance code
# uses: actions/checkout@v4

- name: Checkout ethlance-configs repo
uses: actions/checkout@v4
with:
repository: district0x/ethlance-config
path: ethlance-config
token: ${{ secrets.ETHLANCE_CONFIG_PAT }}
ref: docker_build
# - name: Checkout ethlance-configs repo
# uses: actions/checkout@v4
# with:
# repository: district0x/ethlance-config
# path: ethlance-config
# token: ${{ secrets.ETHLANCE_CONFIG_PAT }}
# ref: docker_build

- name: Copy configs
run: |
cp -r ethlance-config/config .
ls -lah config/
# - name: Copy configs
# run: |
# cp -r ethlance-config/config .
# ls -lah config/

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.AWS_DEFAULT_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
file: docker-builds/${{ matrix.image }}/Dockerfile
build-args: BUILD_ENV=${{ matrix.env }}
push: true
tags: ${{ secrets.ECR_REGISTRY }}/ethlance-${{ matrix.image }}:latest-${{ matrix.env }}
# - name: Build and push
# uses: docker/build-push-action@v4
# with:
# context: .
# platforms: linux/amd64,linux/arm64
# file: docker-builds/${{ matrix.image }}/Dockerfile
# build-args: BUILD_ENV=${{ matrix.env }}
# push: true
# tags: ${{ secrets.ECR_REGISTRY }}/ethlance-${{ matrix.image }}:latest-${{ matrix.env }}

0 comments on commit b195305

Please sign in to comment.