2021-02-19 15:38:54 +08:00
|
|
|
# Upload 📷 UI snapshots to argos server, help visual regression testing.
|
2022-04-22 22:31:39 +08:00
|
|
|
name: 📷 UI Upload
|
2021-02-19 15:38:54 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_run:
|
|
|
|
workflows: ["📷 UI"]
|
|
|
|
types:
|
|
|
|
- completed
|
|
|
|
|
2022-04-11 11:15:26 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-02-19 15:38:54 +08:00
|
|
|
jobs:
|
|
|
|
upload-ui:
|
2022-04-11 11:15:26 +08:00
|
|
|
permissions:
|
|
|
|
actions: read # for dawidd6/action-download-artifact to query and download artifacts
|
|
|
|
pull-requests: read # for dawidd6/action-download-artifact to query commit hash
|
2021-02-19 15:38:54 +08:00
|
|
|
name: deploy preview
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: >
|
|
|
|
github.event.workflow_run.conclusion == 'success'
|
|
|
|
steps:
|
2022-04-22 22:31:39 +08:00
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v3
|
2021-02-19 15:38:54 +08:00
|
|
|
|
2022-04-23 20:58:46 +08:00
|
|
|
- name: Download commit artifact
|
|
|
|
uses: dawidd6/action-download-artifact@v2
|
|
|
|
with:
|
|
|
|
workflow: ${{ github.event.workflow_run.workflow_id }}
|
|
|
|
name: commit
|
|
|
|
|
|
|
|
- name: Save commit id
|
|
|
|
id: commit
|
|
|
|
run: echo "::set-output name=id::$(<commit.txt)"
|
|
|
|
|
|
|
|
- name: Download branch artifact
|
|
|
|
uses: dawidd6/action-download-artifact@v2
|
|
|
|
with:
|
|
|
|
workflow: ${{ github.event.workflow_run.workflow_id }}
|
|
|
|
name: branch
|
|
|
|
|
|
|
|
- name: Save branch id
|
|
|
|
id: branch
|
|
|
|
run: echo "::set-output name=id::$(<branch.txt)"
|
|
|
|
|
2021-02-19 15:38:54 +08:00
|
|
|
- name: Download snapshots artifact
|
|
|
|
uses: dawidd6/action-download-artifact@v2
|
|
|
|
with:
|
|
|
|
workflow: ${{ github.event.workflow_run.workflow_id }}
|
|
|
|
workflow_conclusion: success
|
|
|
|
name: snapshots
|
2022-04-22 22:31:39 +08:00
|
|
|
path: imageSnapshots
|
|
|
|
|
|
|
|
- name: Install
|
|
|
|
run: npm i fast-glob lodash argos-cli
|
2021-02-19 15:38:54 +08:00
|
|
|
|
|
|
|
- name: Upload argos-ci
|
|
|
|
id: deploy
|
2022-04-22 22:31:39 +08:00
|
|
|
run: npm run argos
|
|
|
|
env:
|
|
|
|
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
|
2022-04-23 20:58:46 +08:00
|
|
|
ARGOS_GITHUB_BRANCH: ${{ steps.branch.outputs.id }}
|
|
|
|
ARGOS_GITHUB_COMMIT: ${{ steps.commit.outputs.id }}
|