-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactor GitHub workflows for streamlined build and deploy pro…
…cess (#712) * chore: Refactor GitHub workflows for streamlined build and deploy process - Add reusable build workflow that exports image artifact - Update deploy workflows to use new build and fetch artifact - Rename build-and-deploy to push-and-deploy - Remove unneeded deploy-to-dev workflow - Integrate Slack notifications for builds * docs: add reference for `build-and-export` job
- Loading branch information
1 parent
129c03d
commit 2af2fd0
Showing
6 changed files
with
83 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build image and export artifact | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
slack_alert_webhook: | ||
description: "used to post alerts to slack channel" | ||
required: true | ||
|
||
jobs: | ||
build-and-export: | ||
name: Build and export docker image artifact # https://docs.docker.com/build/ci/github-actions/share-image-jobs/ | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and export | ||
uses: docker/build-push-action@v6 | ||
env: | ||
IMAGE_TAG: ${{ github.sha }} | ||
with: | ||
tags: fmd-image:${IMAGE_TAG} | ||
outputs: type=docker,dest=/tmp/fmd-image.tar | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: fmd-image | ||
path: /tmp/fmd-image.tar | ||
|
||
- name: Slack failure notification | ||
if: ${{ failure() && github.ref == 'refs/heads/main' }} | ||
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 | ||
with: | ||
payload: | | ||
{"blocks":[{"type": "section","text": {"type": "mrkdwn","text": ":no_entry: Failed GitHub Action:"}},{"type": "section","fields":[{"type": "mrkdwn","text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>"},{"type": "mrkdwn","text": "*Job:*\n${{ github.job }}"},{"type": "mrkdwn","text": "*Repo:*\n${{ github.repository }}"}]}]} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters