Skip to content

Publish Oracle Docker Image From Release #9

Publish Oracle Docker Image From Release

Publish Oracle Docker Image From Release #9

name: Publish Oracle Docker Image From Release
on:
workflow_run:
workflows: ["Create Github Release"] # Name of the triggering workflow
types:
- completed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
repository: https://github.com/omni/tokenbridge-contracts
path: ./contracts
ref: 908a48107919d4ab127f9af07d44d47eac91547e
# Step 2: Extract version tag
- name: Get current version tag
id: get_tag
run: |
git fetch --tags
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "::set-output name=version::$latest_tag"
# Step 3: Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}
# Step 4: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Step 5: Build and push Docker image
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./oracle/Dockerfile
push: true
tags: gnosischain/tokenbridge-oracle:${{ steps.get_tag.outputs.version }},gnosischain/tokenbridge-oracle:latest
notify:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: ./.github/workflows/slack_release_notification.yml
with:
environment: Production
service: Tokenbridge Oracle
success: ${{ contains(join(needs.*.result, ','), 'success') }}
message: "Deploy service `Tokenbridge Oracle` version `${{ steps.get_tag.outputs.version }}`. Triggered by `${{ github.actor }}`."