Skip to content

Commit

Permalink
chore: update publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Oct 18, 2023
1 parent 1a8d679 commit dbf98c9
Showing 1 changed file with 8 additions and 30 deletions.
38 changes: 8 additions & 30 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ on:
branches:
- develop
paths:
- ".github/workflows/dockerhub-release.yml"
- ".github/workflows/publish_docker.yml"
- "VERSION"

jobs:
settings:
runs-on: ubuntu-latest
outputs:
# TODO: Edit this section
docker_version: ${{ steps.settings.outputs.supavisor-version }}
image_tag: supabase/supavisor:${{ steps.settings.outputs.supavisor-version }}
build_args: ${{ steps.args.outputs.result }}
docker_version: ${{ steps.settings.outputs.result }}
image_tag: supabase/supavisor:${{ steps.settings.outputs.result }}
build_args: ${{ steps.settings.outputs.result }}
steps:
- uses: actions/checkout@v3
- id: settings
# Remove spaces and quotes to get the raw version string
run: sed -r 's/(\s|\")+//g' VERSION >> $GITHUB_OUTPUT
# Remove spaces to get the raw version string
run: echo "result=$(sed -r 's/\s+//g' VERSION)" >> $GITHUB_OUTPUT

build_image:
needs: settings
Expand Down Expand Up @@ -48,22 +47,10 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true
build-args: |
${{ needs.settings.outputs.build_args }}
target: production
tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
- name: Slack Notification
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }}
SLACK_USERNAME: "gha-failures-notifier"
SLACK_COLOR: "danger"
SLACK_MESSAGE: "Building Supavisor ${{ matrix.arch }} image failed"
SLACK_FOOTER: ""
cache-from: type=gha,scope=${{ github.ref_name }}-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ matrix.arch }}

merge_manifest:
needs: [settings, build_image]
Expand All @@ -79,15 +66,6 @@ jobs:
docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \
${{ needs.settings.outputs.image_tag }}_amd64 \
${{ needs.settings.outputs.image_tag }}_arm64
- name: Slack Notification
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }}
SLACK_USERNAME: "gha-failures-notifier"
SLACK_COLOR: "danger"
SLACK_MESSAGE: "Building Supavisor image failed"
SLACK_FOOTER: ""
publish:
needs: [settings, merge_manifest]
Expand Down

0 comments on commit dbf98c9

Please sign in to comment.