Skip to content

Removes old rippled integration #8

Removes old rippled integration

Removes old rippled integration #8

Workflow file for this run

name: "Package xbridge_witnessd"
on:
push:
branches: ['main', 'release', 'develop', '*-rc*', '*-b*']
pull_request:
workflow_dispatch:
jobs:
package:
name: Build packages
runs-on: [self-hosted, heavy]
container:
image: rippleci/xbwd-builder
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build packages
uses: ./.github/actions/package
- name: Save server
uses: actions/upload-artifact@v3
with:
name: xbwd
path: build/xbridge_witnessd
deploy_image:
runs-on: ubuntu-latest
name: Publish Docker images
needs: package
env:
# The the "latest" image will be built from this branch
LATEST_BRANCH: main
IMAGE_NAME: xbwd
GH_CREDS: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: xbwd
- name: Set tags
id: tag_name
shell: bash
run: |
SHA=${GITHUB_SHA::7}
BASE_IMAGE_NAME=${IMAGE_NAME}:${SHA}
echo "BASE_IMAGE_NAME=${BASE_IMAGE_NAME}" >> $GITHUB_OUTPUT
BRANCH=${GITHUB_REF#refs/heads/}
GH_TAGS="${SHA} ${BRANCH}"
GH_IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}"
echo "GH_IMAGE_NAME=${GH_IMAGE_NAME}" >> $GITHUB_OUTPUT
if [[ $BRANCH == $LATEST_BRANCH ]]; then
echo "Tagging $BRANCH as 'latest'"
GH_TAGS+=" latest"
fi
echo "GH_TAGS=${GH_TAGS}" >> $GITHUB_OUTPUT
- name: Build Docker image
shell: bash
run: |
IMAGE=${{ steps.tag_name.outputs.BASE_IMAGE_NAME }}
chmod +x xbridge_witnessd
docker build . -t ${IMAGE} --file .github/actions/image/Dockerfile
docker run --rm ${IMAGE} /opt/xbwd/bin/xbridge_witnessd --version
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to ghcr
shell: bash
run: |
for tag in ${{ steps.tag_name.outputs.GH_TAGS }}; do
echo "Tagging ${{ steps.tag_name.outputs.BASE_IMAGE_NAME}} to ${{ steps.tag_name.outputs.GH_IMAGE_NAME }}:${tag} for GHCR"
docker tag ${{ steps.tag_name.outputs.BASE_IMAGE_NAME}} ${{ steps.tag_name.outputs.GH_IMAGE_NAME }}:${tag}
echo "Pushing ${{ steps.tag_name.outputs.GH_IMAGE_NAME }}:${tag} to GHCR"
docker push ${{ steps.tag_name.outputs.GH_IMAGE_NAME }}:${tag}
done