push only on certain branches
This commit is contained in:
parent
e15029f6e0
commit
7f97d6e0a8
|
@ -1,18 +1,8 @@
|
||||||
# This workflow uses actions that are not certified by GitHub.
|
|
||||||
# They are provided by a third-party and are governed by
|
|
||||||
# separate terms of service, privacy policy, and support
|
|
||||||
# documentation.
|
|
||||||
|
|
||||||
# GitHub recommends pinning actions to a commit SHA.
|
|
||||||
# To get a newer version, you will need to update the SHA.
|
|
||||||
# You can also reference a tag or branch, but the action may change without warning.
|
|
||||||
|
|
||||||
name: Create and publish a Docker image
|
name: Create and publish a Docker image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main", "build-docker-images-on-main-too"]
|
||||||
pull_request:
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
@ -23,31 +13,30 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout trustless-generic-relayer
|
- name: Checkout trustless-generic-relayer
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
path: trustless-generic-relayer
|
|
||||||
- name: Checkout wormhole
|
- name: Checkout wormhole
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: wormhole-foundation/wormhole
|
repository: wormhole-foundation/wormhole
|
||||||
path: trustless-generic-relayer/ethereum/wormhole
|
path: ethereum/wormhole
|
||||||
ref: feat/batch_vaa_alternative
|
ref: feat/batch_vaa_alternative
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
trustless-generic-relayer/ethereum/package-lock.json
|
ethereum/package-lock.json
|
||||||
trustless-generic-relayer/ethereum/wormhole/ethereum/package-lock.json
|
ethereum/wormhole/ethereum/package-lock.json
|
||||||
trustless-generic-relayer/relayer_engine/package-lock.json
|
relayer_engine/package-lock.json
|
||||||
trustless-generic-relayer/sdk/package-lock.json
|
sdk/package-lock.json
|
||||||
|
- name: Install Foundry
|
||||||
|
uses: foundry-rs/foundry-toolchain@v1
|
||||||
- name: Generate contract typechain typings
|
- name: Generate contract typechain typings
|
||||||
run: |
|
run: |
|
||||||
cd trustless-generic-relayer/ethereum
|
cd ethereum
|
||||||
../scripts/install-foundry
|
make build
|
||||||
PATH=$PATH:$HOME/.foundry/bin/ make build
|
- name: Install relayer engine dependencies
|
||||||
- name: npm ci generic relayer plugin
|
|
||||||
run: |
|
run: |
|
||||||
cd trustless-generic-relayer/relayer_engine
|
cd relayer_engine
|
||||||
npm ci
|
npm ci
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
|
@ -66,7 +55,7 @@ jobs:
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
with:
|
with:
|
||||||
context: trustless-generic-relayer/relayer_engine
|
context: relayer_engine
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
|
@ -76,55 +76,3 @@ jobs:
|
||||||
cd relayer_engine
|
cd relayer_engine
|
||||||
npm ci
|
npm ci
|
||||||
npx tsc --noEmit --project tsconfig.json
|
npx tsc --noEmit --project tsconfig.json
|
||||||
|
|
||||||
docker-push:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout trustless-generic-relayer
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Checkout wormhole
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: wormhole-foundation/wormhole
|
|
||||||
path: ethereum/wormhole
|
|
||||||
ref: feat/batch_vaa_alternative
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
cache: "npm"
|
|
||||||
cache-dependency-path: |
|
|
||||||
ethereum/package-lock.json
|
|
||||||
ethereum/wormhole/ethereum/package-lock.json
|
|
||||||
relayer_engine/package-lock.json
|
|
||||||
sdk/package-lock.json
|
|
||||||
- name: Install Foundry
|
|
||||||
uses: foundry-rs/foundry-toolchain@v1
|
|
||||||
- name: Generate contract typechain typings
|
|
||||||
run: |
|
|
||||||
cd ethereum
|
|
||||||
make build
|
|
||||||
- name: Install relayer engine dependencies
|
|
||||||
run: |
|
|
||||||
cd relayer_engine
|
|
||||||
npm ci
|
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
|
||||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
|
||||||
with:
|
|
||||||
context: relayer_engine
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
Loading…
Reference in New Issue