Skip to content

Commit

Permalink
Create CI workflow for ledger exporter release
Browse files Browse the repository at this point in the history
  • Loading branch information
urvisavla committed Jul 1, 2024
1 parent a5e50c4 commit d726f57
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 27 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,30 +149,3 @@ jobs:
name: Push to DockerHub
run: docker push stellar/horizon-verify-range:latest

ledger-exporter:
name: Test and push the Ledger Exporter images
runs-on: ubuntu-latest
env:
STELLAR_CORE_VERSION: 21.0.0-1872.c6f474133.focal
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Build Ledger Exporter docker
run: make -C exp/services/ledgerexporter docker-build

- name: Run Ledger Exporter test
run: make -C exp/services/ledgerexporter docker-test

# Push images
- if: github.ref == 'refs/heads/master'
name: Login to DockerHub
uses: docker/login-action@bb984efc561711aaa26e433c32c3521176eae55b
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- if: github.ref == 'refs/heads/master'
name: Push to DockerHub
run: make -C exp/services/ledgerexporter docker-push
36 changes: 36 additions & 0 deletions .github/workflows/ledgerexporter-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Ledger Exporter release

on:
push:
tags: ['ledgerexporter-v*']

jobs:

publish-docker:
name: Test and push the Ledger Exporter images
runs-on: ubuntu-latest
env:
STELLAR_CORE_VERSION: 21.0.0-1872.c6f474133.focal
VERSION: ${GITHUB_REF_NAME#ledgerexporter-v}
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Build Ledger Exporter docker
run: make -C exp/services/ledgerexporter docker-build

- name: Run Ledger Exporter test
run: make -C exp/services/ledgerexporter docker-test

# Push images
- if: github.ref == 'refs/heads/master'
name: Login to DockerHub
uses: docker/login-action@bb984efc561711aaa26e433c32c3521176eae55b
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- if: github.ref == 'refs/heads/master'
name: Push to DockerHub
run: make -C exp/services/ledgerexporter docker-push
24 changes: 24 additions & 0 deletions .github/workflows/ledgerexporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: LedgerExporter

on:
push:
branches: [master]
pull_request:

jobs:
ledger-exporter:
name: Build and test Ledger Exporter image
runs-on: ubuntu-latest
env:
STELLAR_CORE_VERSION: 21.0.0-1872.c6f474133.focal
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Build Ledger Exporter docker
run: make -C exp/services/ledgerexporter docker-build

- name: Run Ledger Exporter test
run: make -C exp/services/ledgerexporter docker-test

0 comments on commit d726f57

Please sign in to comment.