Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update uffizzi preview actions #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/uffizzi-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build PR Image
on:
pull_request:
types: [opened,synchronize,reopened,closed]
types: [opened, synchronize, reopened, closed]

jobs:

build-application:
name: Build and Push `f-ui-kit`
runs-on: ubuntu-latest
Expand All @@ -15,7 +14,7 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v2
- name: Generate UUID image name
id: uuid
run: echo "UUID_TAG_APP=$(uuidgen)" >> $GITHUB_ENV
Expand All @@ -40,7 +39,7 @@ jobs:
name: Render Docker Compose File
# Pass output of this workflow to another triggered by `workflow_run` event.
runs-on: ubuntu-latest
needs:
needs:
- build-application
outputs:
compose-file-cache-key: ${{ steps.hash.outputs.hash }}
Expand All @@ -61,10 +60,10 @@ jobs:
path: docker-compose.rendered.yml
retention-days: 2
- name: Serialize PR Event to File
run: |
run: |
cat << EOF > event.json
${{ toJSON(github.event) }}
${{ toJSON(github.event) }}

EOF
- name: Upload PR Event as Artifact
uses: actions/upload-artifact@v3
Expand All @@ -87,4 +86,3 @@ jobs:
name: preview-spec
path: event.json
retention-days: 2

7 changes: 3 additions & 4 deletions .github/workflows/uffizzi-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
branches-ignore:
- "main"


jobs:
cache-compose-file:
name: Cache Compose File
Expand All @@ -18,7 +17,7 @@ jobs:
compose-file-cache-key: ${{ env.COMPOSE_FILE_HASH }}
pr-number: ${{ env.PR_NUMBER }}
steps:
- name: 'Download artifacts'
- name: "Download artifacts"
# Fetch output (zip archive) from the workflow run that triggered this workflow.
uses: actions/github-script@v6
with:
Expand All @@ -39,7 +38,7 @@ jobs:
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data));
- name: 'Unzip artifact'
- name: "Unzip artifact"
run: unzip preview-spec.zip
- name: Read Event into ENV
run: |
Expand Down Expand Up @@ -72,7 +71,7 @@ jobs:
name: Use Remote Workflow to Preview on Uffizzi
needs:
- cache-compose-file
uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2.6.1
uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2
with:
# If this workflow was triggered by a PR close event, cache-key will be an empty string
# and this reusable workflow will delete the preview deployment.
Expand Down