Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt committed May 13, 2024
1 parent 696ff22 commit a93e2e7
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/build-push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
# types: [published]

jobs:
get-variables:
setup-build:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.get-date.outputs.date }}
Expand All @@ -34,8 +34,8 @@ jobs:
id: get-tag
run: echo "tag=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//')" >> $GITHUB_OUTPUT

build-and-push-production-images:
needs: get-variables
build-and-push-amd64:
needs: setup-build
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -58,12 +58,12 @@ jobs:
push: true
tags: |
lunary/${{ matrix.service }}:latest
lunary/${{ matrix.service }}:rev-${{ needs.get-variables.outputs.date }}-${{ needs.get-variables.outputs.hash }}
${{ github.event.release.tag_name != '' && format('lunary/{0}:{1}', matrix.service, needs.get-variables.outputs.tag) || '' }}
lunary/${{ matrix.service }}:rev-${{ needs.setup-build.outputs.date }}-${{ needs.setup-build.outputs.hash }}
${{ github.event.release.tag_name != '' && format('lunary/{0}:{1}', matrix.service, needs.setup-build.outputs.tag) || '' }}
platforms: linux/amd64

deploy:
needs: build-and-push-production-images
needs: build-and-push-amd64
runs-on: ubuntu-latest
steps:
- name: Deploy to Production
Expand All @@ -80,8 +80,8 @@ jobs:
docker compose down
docker compose up -d
build-and-push-other-images:
needs: get-variables
build-lunary-ee-and-frontend:
needs: setup-build
strategy:
matrix:
service: [frontend, lunary-ee]
Expand All @@ -92,18 +92,3 @@ jobs:

- name: Login to private Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

- name: Build and push lunary-ee
uses: docker/build-push-action@v5
with:
context: .
file: ./ops/{{ matrix.service }}.Dockerfile
push: true
tags: |
lunary/${{ matrix.service }}:latest
lunary/${{ matrix.service }}:rev-${{ needs.get-variables.outputs.date }}-${{ needs.get-variables.outputs.hash }}
${{ github.event.release.tag_name != '' && format('lunary/{0}:{1}', matrix.service, needs.get-variables.outputs.tag) || '' }}
platforms: linux/amd64

0 comments on commit a93e2e7

Please sign in to comment.