Skip to content

Commit

Permalink
Update release.yml (#162)
Browse files Browse the repository at this point in the history
* Update release.yml

* Update release.yml

* Update release.yml

fix unrecognized variables

* Update release.yml

fix empty version

* Update release.yml

* Update release.yml
  • Loading branch information
johnsonjie authored Jan 24, 2024
1 parent 09d6208 commit 73353cb
Showing 1 changed file with 12 additions and 31 deletions.
43 changes: 12 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- 'v*.*.*'

env:
AWS_REGION: us-west-2

Expand All @@ -19,15 +20,6 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
scrolltech/rollup-explorer-backend
tags: |
type=semver,pattern={{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -37,20 +29,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Github
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.PAT_OWNER }}
password: ${{ secrets.PAT_TOKEN }}

- name: Build image
id: build
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}

# build and push to aws ecr
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -63,14 +41,17 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push image to Amazon ECR
id: build-image
- name: Build image
id: build
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: rollup-explorer-backend
IMAGE_TAG: ${{github.ref_name}}
run: |
# Build a docker container and push it to ECR
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
IMAGE_TAG: ${{ github.ref_name }}
uses: docker/build-push-action@v3
with:
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.ECR_REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest

0 comments on commit 73353cb

Please sign in to comment.