Skip to content

Commit

Permalink
Add republish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
krolol committed Jun 5, 2024
1 parent 570246f commit b81082c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/republish-dev-image-to-dockerhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Republish dev-latest docker image to DockerHub
on:
workflow_dispatch:

env:
ECR_REPOSITORY: pos-network-node
DOCKERHUB_REPOSITORY: cerebellumnetwork
PACKAGE_NAME: pos-node
jobs:
tag-and-push:
runs-on: [self-hosted, cere-network-xlarge]
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEV_NETWORK_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_NETWORK_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Pull image from ECR and change name, push tagged version to ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
docker pull $ECR_REGISTRY/$ECR_REPOSITORY:dev-latest
docker image tag $ECR_REGISTRY/$ECR_REPOSITORY:dev-latest $DOCKERHUB_REPOSITORY/$PACKAGE_NAME:dev-latest
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish image to DockerHub
id: docker_publish
run: |
docker push -a $DOCKERHUB_REPOSITORY/$PACKAGE_NAME:dev-latest
- name: Image digest
run: echo ${{ steps.docker_publish.outputs.digest }}

0 comments on commit b81082c

Please sign in to comment.