Skip to content

Commit

Permalink
patch:Fix Continuous Deployment of Frontera, in prod (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviuOpenline authored Feb 21, 2025
1 parent 130f01f commit d037f39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
39 changes: 12 additions & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,28 @@ jobs:
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
github.event_name == 'workflow_dispatch'
steps:
- name: Get workflow output
id: workflow_output
- name: Download workflow data
if: github.event_name == 'workflow_run'
uses: actions/github-script@v6
uses: actions/download-artifact@v4
with:
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
const matchArtifact = allArtifacts.data.artifacts.find((artifact) => {
return artifact.name == "workflow-data"
});
name: workflow-data
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
const fs = require('fs');
fs.writeFileSync('workflow-data.zip', Buffer.from(download.data));
const execSync = require('child_process').execSync;
execSync('unzip workflow-data.zip');
const workflowData = JSON.parse(fs.readFileSync('workflow-data.json', 'utf8'));
core.setOutput('next_version', workflowData.next_version);
- name: Read workflow data
id: workflow_data
if: github.event_name == 'workflow_run'
run: |
next_version=$(cat workflow-data.json | jq -r .next_version)
echo "next_version=${next_version}" >> $GITHUB_OUTPUT
- name: Set version
id: set_version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${{ steps.workflow_output.outputs.next_version }}" >> $GITHUB_OUTPUT
echo "version=${{ steps.workflow_data.outputs.next_version }}" >> $GITHUB_OUTPUT
fi
- name: Trigger Frontera App Workflow
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
- name: Upload workflow outputs
if: steps.generate_version.outputs.should_release == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: workflow-data
path: workflow-data.json

0 comments on commit d037f39

Please sign in to comment.