From 090d384c3d043f9f81184bbfbf0dc32862f008ef Mon Sep 17 00:00:00 2001 From: qtrinh2 Date: Fri, 14 Apr 2023 12:47:42 -0400 Subject: [PATCH] Update build-deliver.yml --- .github/workflows/build-deliver.yml | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-deliver.yml b/.github/workflows/build-deliver.yml index 3a7290c..1fc929b 100644 --- a/.github/workflows/build-deliver.yml +++ b/.github/workflows/build-deliver.yml @@ -19,17 +19,21 @@ jobs: steps: - uses: actions/checkout@v3 - - - name: Build Docker Image (prod) - if: github.ref == 'refs/heads/main' + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ${{ env.REGISTRY }} + + - name: Build and Push Docker Image for Local Dev uses: docker/build-push-action@v4 with: context: . - push: false + push: true tags: "${{ env.IMAGE_NAME }}:latest" platforms: linux/amd64 - build-args: | - configfile=_config-production.yml - name: Build Docker Image(devl) if: github.ref == 'refs/heads/preview' @@ -41,6 +45,17 @@ jobs: platforms: linux/amd64 build-args: | configfile=_config-dev.yml + + - name: Build Docker Image (prod) + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v4 + with: + context: . + push: false + tags: "${{ env.IMAGE_NAME }}:latest" + platforms: linux/amd64 + build-args: | + configfile=_config-production.yml - name: Extract build artifact from docker image uses: shrink/actions-docker-extract@v2 @@ -58,21 +73,6 @@ jobs: path: ./dist.tar.gz name: dist - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ${{ env.REGISTRY }} - - - name: Build and Push Docker Image for Local Dev - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: "${{ env.IMAGE_NAME }}:latest" - platforms: linux/amd64 - release: needs: build uses: chnm/.github/.github/workflows/create-release.yml@feature/initial-reusable-workflows