Skip to content

Commit

Permalink
Update artifact name
Browse files Browse the repository at this point in the history
  • Loading branch information
maiquanghiep committed Aug 5, 2024
1 parent e6fae21 commit 62a0006
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ on:
# - '*'

jobs:
test:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@hiep/add-nodejs-workflows
docker_build:
needs: [lint_test]
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -35,7 +36,7 @@ jobs:
uses: docker/build-push-action@v6
with:
tags: simple-staking:${{ github.sha }}
outputs: type=docker,dest=/tmp/simple-staking.tar
outputs: type=docker,dest=/tmp/simple-staking-${{ matrix.environment }}.tar
build-args: |
NEXT_PUBLIC_MEMPOOL_API=${{ vars.NEXT_PUBLIC_MEMPOOL_API }}
NEXT_PUBLIC_API_URL=${{ vars.NEXT_PUBLIC_API_URL }}
Expand All @@ -46,7 +47,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: simple-staking
path: /tmp/simple-staking.tar
path: /tmp/simple-staking-${{ matrix.environment }}.tar

dockerhub_publish:
runs-on: ubuntu-22.04
Expand All @@ -59,7 +60,7 @@ jobs:
path: /tmp/

- name: Load Docker image
run: docker load -i /tmp/simple-staking.tar
run: docker load -i /tmp/simple-staking-${{ matrix.environment }}.tar

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -69,7 +70,7 @@ jobs:

- name: Push Docker image with SHA
run: |
docker tag simple-staking:${{ github.sha }} ${{ vars.DOCKERHUB_REGISTRY_ID }}/simple-staking:${{ github.sha }}
docker tag simple-staking:${{ github.sha }} ${{ vars.DOCKERHUB_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }}
docker push ${{ vars.DOCKERHUB_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }}
- name: Push Docker image with Tag
Expand All @@ -89,7 +90,7 @@ jobs:
path: /tmp/

- name: Load Docker image
run: docker load -i /tmp/simple-staking.tar
run: docker load -i /tmp/simple-staking-${{ matrix.environment }}.tar

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -104,15 +105,11 @@ jobs:

- name: Push Docker image with SHA
run: |
docker tag simple-staking:${{ github.sha }} ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.sha }}
docker tag simple-staking:${{ github.sha }} ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }}
docker push ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }}
- name: Push Docker image with Tag
if: startsWith(github.ref, 'refs/tags/')
run: |
docker tag simple-staking:${{ github.sha }} ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.ref_name }}-${{ matrix.environment }}
docker push ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.ref_name }}-${{ matrix.environment }}
docker push ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.ref_name }}-${{ matrix.environment }}

0 comments on commit 62a0006

Please sign in to comment.