Skip to content

Commit

Permalink
Update build-deliver.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
qtrinh2 authored Apr 14, 2023
1 parent f2c45c8 commit 090d384
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/build-deliver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 090d384

Please sign in to comment.