Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #104 from omgnetwork/develop
Browse files Browse the repository at this point in the history
Panda 4 real
  • Loading branch information
InoMurko authored Oct 27, 2021
2 parents a313649 + 56ec0eb commit d511ce7
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 3 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/boba-publish-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Publish Packages (boba-develop)

on:
push:
branches:
- 'develop'

jobs:

start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-00b46fa1102c70ff2
ec2-instance-type: t2.xlarge
subnet-id: subnet-905870ae
security-group-id: sg-0855631d714870b32

build-publish-win:
needs: start-runner
runs-on: ${{ needs.start-runner.outputs.label }}

steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}

- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build the services
working-directory: ./ops
run: |
./scripts/build-ci.sh
- name: Rename and retag the optimism images
working-directory: ./ops
run: |
for i in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep bobanetwork); do
docker image tag "$i" bobanetwork/$(echo $i | awk -F'/' '{print $2}' | awk -F':' '{print $1}'):latest
done
docker images
- name: Rename and retag the optimism images
working-directory: ./ops
run: |
for i in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep bobanetwork); do
echo "$1"
docker push "$i"
done
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- build-publish-win # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
72 changes: 72 additions & 0 deletions .github/workflows/boba-publish-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish Packages (boba-master)

on:
push:
tags:
- '*'

jobs:
build-publish-win:
runs-on: ubuntu-latest

steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Get the version
id: tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Print current tag
run: echo ${{ steps.tag.outputs.VERSION }}

- name: Build the services
working-directory: ./ops
run: |
./scripts/build-ci.sh
- name: Rename and retag the Optimism images
working-directory: ./ops
run: |
for i in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep bobanetwork); do
docker image tag "$i" bobanetwork/$(echo $i | awk -F'/' '{print $2}' | awk -F':' '{print $1}'):${{ steps.tag.outputs.VERSION }}
done
docker images
docker images | grep ${{ steps.tag.outputs.VERSION }}
- name: Rename and retag the optimism images
working-directory: ./ops
run: |
for i in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep bobanetwork); do
echo "$1"
docker push "$i"
done
# - name: Build and push docker images to AWS
# working-directory: ./ops_boba
# run: |
# rm -rf cloudformation/deployer-rinkeby.yaml cloudformation/dummy-transaction.yaml cloudformation/omgx-monitor.yaml cloudformation/blockexplorer-blockscout.yaml cloudformation/transaction-monitor.yaml
# ./cfn-devenv.sh push2aws --from-tag ${{ steps.tag.outputs.VERSION }} --deploy-tag ${{ steps.tag.outputs.VERSION }}
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Release

# boba doesnt want to run this flow
on:
push:
branches:
- master
branches-ignore:
- '*'
- '*/**'
pull_request:
branches-ignore:
- '*'
- '*/**'

jobs:
release:
Expand Down

0 comments on commit d511ce7

Please sign in to comment.