Skip to content

test new gh workflow #20

test new gh workflow

test new gh workflow #20

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "add_dockerfiles", "newlance", "test_new_workflow" ]
pull_request:
branches: [ "add_dockerfiles", "newlance" ]
permissions:
contents: read
jobs:
testing:
permissions:
contents: read
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]
ipfs-daemon:
image: district0x/ipfs-daemon:latest
postgres:
image: postgres
env:
POSTGRES_PASSWORD: pass
POSTGRES_USER: ethlanceuser
POSTGRES_DB: ethlance-test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
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: Copy configs
run: |
cp -r ethlance-config/config .
ls -lah config/
- name: Copy configs
run: |
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: 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: Set up QEMU
uses: docker/setup-qemu-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: 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 }}