Skip to content

Commit

Permalink
github workflows: factor out docker publish of joystream/node:latest …
Browse files Browse the repository at this point in the history
…workflow
  • Loading branch information
mnaamani committed Apr 24, 2023
1 parent e118a4f commit 90cbc19
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/joystream-node-docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Publish production runtime build joystream/node:latest
name: joystream-node-docker-publish

on:
- workflow_dispatch

env:
REPOSITORY: joystream/node

jobs:
repo-check:
name: Check if main image already published
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '14.x'

- id: compute_shasum
name: Compute runtime code shasum
run: |
export TAG_SHASUM=`scripts/runtime-code-shasum.sh`
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Publish joystream/node:latest manifest
run: |
IMAGE=${{ env.REPOSITORY }}:${{ env.TAG_SHASUM }}
LATEST_TAG=${{ env.REPOSITORY }}:latest
docker manifest create $LATEST_TAG $IMAGE-amd64 $IMAGE-arm64
docker manifest annotate $LATEST_TAG $IMAGE-amd64 --arch amd64
docker manifest annotate $LATEST_TAG $IMAGE-arm64 --arch arm64
docker manifest push $LATEST_TAG
9 changes: 0 additions & 9 deletions .github/workflows/joystream-node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,3 @@ jobs:
docker manifest annotate $IMAGE $IMAGE-arm64 --arch arm64
docker manifest push $IMAGE
- name: Create manifest with latest tag for master
if: github.ref == 'refs/heads/master'
run: |
IMAGE=${{ env.REPOSITORY }}:${{ env.TAG_SHASUM }}
LATEST_TAG=${{ env.REPOSITORY }}:latest
docker manifest create $LATEST_TAG $IMAGE-amd64 $IMAGE-arm64
docker manifest annotate $LATEST_TAG $IMAGE-amd64 --arch amd64
docker manifest annotate $LATEST_TAG $IMAGE-arm64 --arch arm64
docker manifest push $LATEST_TAG

0 comments on commit 90cbc19

Please sign in to comment.