ci: ensure the check-for-changes checks previous deployed version #2178
Workflow file for this run
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
name: CI/CD Pull Request | |
on: | |
pull_request: | |
branches: [main] | |
permissions: write-all | |
jobs: | |
get-versions-from-github: | |
name: Get Latest Deployed Versions from GitHub Variables | |
uses: ./.github/workflows/workflow-get-latest-deployed-versions-from-github.yml | |
with: | |
environment: test | |
secrets: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
mock-deployment: | |
name: Mock Deployment | |
needs: [get-versions-from-github] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo Infra Version | |
run: echo "Mock deploying infrastructure version ${{ needs.get-versions-from-github.outputs.infra_version_sha }}" | |
- name: Echo Apps Version | |
run: echo "Mock deploying applications version ${{ needs.get-versions-from-github.outputs.apps_version_sha }}" | |
store-mock-versions: | |
name: Store Mock Versions | |
needs: [mock-deployment] | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Set Mock Infra Version | |
run: | | |
gh variable set LATEST_DEPLOYED_INFRA_VERSION --body "v1.0.0-mock" --env test --repo ${{ github.repository }} | |
- name: Set Mock Apps Version | |
run: | | |
gh variable set LATEST_DEPLOYED_APPS_VERSION --body "v1.0.0-mock" --env test --repo ${{ github.repository }} | |
verify-stored-versions: | |
name: Verify Stored Versions | |
needs: [store-mock-versions] | |
uses: ./.github/workflows/workflow-get-latest-deployed-versions-from-github.yml | |
with: | |
environment: test | |
secrets: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
echo-verified-versions: | |
name: Echo Verified Versions | |
needs: [verify-stored-versions] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo Verified Infra Version | |
run: echo "Verified infrastructure version ${{ needs.verify-stored-versions.outputs.infra_version_sha }}" | |
- name: Echo Verified Apps Version | |
run: echo "Verified applications version ${{ needs.verify-stored-versions.outputs.apps_version_sha }}" |