Skip to content

Commit

Permalink
update ci workflow for prod and qa
Browse files Browse the repository at this point in the history
  • Loading branch information
sm47916 committed Jun 28, 2024
1 parent f31067b commit 449ceeb
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 4 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/docker-image-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Docker Prod Image

on:
push:
branches: [ "master", "main", "newlance", "build_prod"]

permissions:
contents: read

jobs:
docker_build_prod:
name: Build images and deploy contracts
strategy:
matrix:
env: ["prod"]
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout ethlance code
uses: actions/checkout@v4

- name: Restore Top level cache directory for Ethlance
uses: actions/cache@v3
id: yarn-cache-top-level
with:
path: ./node_modules
key: ${{ runner.os }}-ethlance-top-level-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-ethlance-top-level-yarn-
- name: Install ethlance top-level node modules
run: |
yarn install
- name: Set up QEMU
id: setup-qemu
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: setup-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: Checkout ethlance-configs repo
uses: actions/checkout@v4
with:
repository: district0x/ethlance-config
path: ethlance-config
token: ${{ secrets.ETHLANCE_CONFIG_PAT }}
ref: master

- name: Copy configs
run: |
cp -r ethlance-config/config .
ls -lah config/
- name: Build and push UI
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
builder: ${{ steps.setup-buildx.outputs.name }}
file: docker-builds/ui/Dockerfile
build-args: BUILD_ENV=${{ matrix.env }}
push: true
tags: ${{ secrets.ECR_REGISTRY }}/ethlance-ui:latest-${{ matrix.env }}

- name: Build and push Server
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.setup-buildx.outputs.name }}
platforms: linux/amd64
file: docker-builds/server/Dockerfile
build-args: BUILD_ENV=${{ matrix.env }}
push: true
tags: ${{ secrets.ECR_REGISTRY }}/ethlance-server:latest-${{ matrix.env }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Docker Image CI
name: Docker CI and QA Image

on:
push:
branches: [ "master", "main", "newlance", "build_prod"]
pull_request:

permissions:
Expand Down Expand Up @@ -98,7 +96,7 @@ jobs:
needs: run_tests
strategy:
matrix:
env: ["qa", "prod"]
env: ["qa"]
permissions:
contents: read
runs-on: ubuntu-latest
Expand Down

0 comments on commit 449ceeb

Please sign in to comment.