Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Publish aggregator images using CI #504

Merged
merged 9 commits into from
Feb 9, 2023
Merged

Conversation

voltrevo
Copy link
Collaborator

@voltrevo voltrevo commented Feb 3, 2023

What is this PR doing?

  • Adds functionality to build.ts for pushing docker images to dockerhub
  • Adds a github action for doing this when main is updated

How can these changes be manually tested?

  1. Run the github action and make sure the container is pushed to dockerhub
  2. Test the container by running ./manualTests/mint1ViaAggregator.ts against it

Does this PR resolve or contribute to any issues?

Resolves #91.

Checklist

  • I have manually tested these changes
  • Post a link to the PR in the group chat

Guidelines

  • If your PR is not ready, mark it as a draft
  • The resolve conversation button is for reviewers, not authors
    • (But add a 'done' comment or similar)

@github-actions github-actions bot added aggregator Aggregator backend related automation CI/CD related labels Feb 3, 2023
@voltrevo voltrevo marked this pull request as ready for review February 6, 2023 05:10
@voltrevo voltrevo changed the title Bw 91 publish agg image Publish aggregator images using CI Feb 6, 2023
Copy link
Collaborator

@jacque006 jacque006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to move in the future to https://github.com/docker/build-push-action so we don't need to maintain a separate docker build script and can take advantage of features such as caching, platforms such as ARM, and others

Comment on lines +5 to +29
branches:
- 'main'
paths:
- 'aggregator/**'
- '.github/workflows/aggregator-dockerhub.yml'

defaults:
run:
working-directory: ./aggregator

env:
DENO_VERSION: 1.x

jobs:
push:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- run: git show HEAD
- run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username blswalletghactions --password-stdin
- run: ./programs/build.ts --image-name blswallet/aggregator --image-only --also-tag-latest --push
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's little cost to pushing up every commit. This also will make it easier to share agg images early when testing bug fixes with external devs, and will make it easier to test the image in the future to ensure it is working.

Suggested change
branches:
- 'main'
paths:
- 'aggregator/**'
- '.github/workflows/aggregator-dockerhub.yml'
defaults:
run:
working-directory: ./aggregator
env:
DENO_VERSION: 1.x
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- run: git show HEAD
- run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username blswalletghactions --password-stdin
- run: ./programs/build.ts --image-name blswallet/aggregator --image-only --also-tag-latest --push
paths:
- 'aggregator/**'
- '.github/workflows/aggregator-dockerhub.yml'
defaults:
run:
working-directory: ./aggregator
env:
DENO_VERSION: 1.x
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- run: git show HEAD
- run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username blswalletghactions --password-stdin
- run: ./programs/build.ts --image-name blswallet/aggregator --image-only --push

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can then tag in another step on main or git tag/GH release

  push-latest
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    needs: [push]

    steps:
    - run: docker tag IMAGE blswallet/aggregator:latest # or version
    - run: docker push blswallet/aggregator:latest

@voltrevo voltrevo merged commit 99ed78b into main Feb 9, 2023
@voltrevo voltrevo deleted the bw-91-publish-agg-image branch February 9, 2023 01:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aggregator Aggregator backend related automation CI/CD related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish aggregator container image
2 participants