Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/external.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Trigger external stg workflow
on:
push:
branches: ["main"]
permissions:
contents: read
id-token: write
actions: read
jobs:
build-push-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Get github app token
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
id: gh-app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Trigger external workflow
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{ steps.gh-app-token.outputs.token }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'OpenZeppelin',
repo: 'openzeppelin-relayer-infra',
workflow_id: 'stg.yml',
ref: 'main'
})
29 changes: 29 additions & 0 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit

- name: Slack notification
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
with:
Expand All @@ -29,10 +30,12 @@ jobs:
channel: ${{ env.SLACK_CHANNEL }}
message: Starting docker build and push to dockerhub for ${{ github.repository }} with tag ${{ inputs.tag }}......
if: always()

- name: Checkout release branch
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.tag }}

- name: Docker meta
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
Expand All @@ -52,11 +55,13 @@ jobs:
org.opencontainers.image.description="OpenZeppelin Relayer service provides infrastructure to relay transactions to the EVM and Non-EVM networks."
env:
DOCKER_METADATA_SHORT_SHA_LENGTH: 10

- name: Login to Dockerhub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}

- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Build Docker image
Expand All @@ -73,12 +78,33 @@ jobs:
sbom: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Get github app token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: gh-app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Trigger external workflows
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{ steps.gh-app-token.outputs.token }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'OpenZeppelin',
repo: 'openzeppelin-relayer-infra',
workflow_id: 'testnet.yml',
ref: 'main'
})

await github.rest.actions.createWorkflowDispatch({
owner: 'OpenZeppelin',
repo: 'openzeppelin-relayer-infra',
workflow_id: 'mainnet.yml',
ref: 'main'
})

- name: Attest
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
id: attest
Expand All @@ -87,6 +113,7 @@ jobs:
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: false
github-token: ${{ steps.gh-app-token.outputs.token }}

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
with:
Expand All @@ -95,6 +122,7 @@ jobs:
repository: ${{ env.DOCKERHUB_IMAGE }}
short-description: ${{ github.event.repository.description }}
readme-filepath: ./DOCKER_README.md

- name: Slack notification success or failure
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
with:
Expand All @@ -103,6 +131,7 @@ jobs:
channel: ${{ env.SLACK_CHANNEL }}
message: Push to Dockerhub ${{ job.status }}!
if: always()

- name: Print image digest to summary
run: |-
echo "Image tags: ${{ steps.meta.outputs.tags }}" >> "${GITHUB_STEP_SUMMARY}"
Expand Down