mirror of
https://github.com/vercel/commerce.git
synced 2025-05-31 21:46:58 +00:00
chore: Update develop.deploy-functions.yml to conditionally set environment variables and authenticate with Google Cloud
This commit is contained in:
parent
ff0e51bbec
commit
33c1dda984
16
.github/workflows/develop.deploy-functions.yml
vendored
16
.github/workflows/develop.deploy-functions.yml
vendored
@ -21,11 +21,23 @@ jobs:
|
|||||||
uses: 'actions/checkout@v4'
|
uses: 'actions/checkout@v4'
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
- name: Get Previous deployments
|
||||||
|
id: get_deployments
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const deployments = await github.rest.repos.listDeployments({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
sha: context.sha
|
||||||
|
});
|
||||||
|
return deployments.data;
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
id: semantic
|
id: semantic
|
||||||
uses: cycjimmy/semantic-release-action@v4
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- name: Set Environment Variables
|
- name: Set Environment Variables
|
||||||
if: steps.semantic.outputs.new_release_published == 'true'
|
if: steps.semantic.outputs.new_release_published == 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -78,11 +90,11 @@ jobs:
|
|||||||
token: '${{ secrets.GH_TOKEN }}'
|
token: '${{ secrets.GH_TOKEN }}'
|
||||||
environment-url: ${{steps.deploy.outputs.url}}
|
environment-url: ${{steps.deploy.outputs.url}}
|
||||||
state: 'success'
|
state: 'success'
|
||||||
deployment-id: ${{ github.run_id }}
|
deployment-id: ${{ steps.get_deployments.outputs[0].id }}
|
||||||
- name: Update deployment status (failure)
|
- name: Update deployment status (failure)
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: chrnorm/deployment-status@v2
|
uses: chrnorm/deployment-status@v2
|
||||||
with:
|
with:
|
||||||
token: '${{ secrets.GH_TOKEN}}'
|
token: '${{ secrets.GH_TOKEN}}'
|
||||||
state: 'failure'
|
state: 'failure'
|
||||||
deployment-id: ${{ github.run_id }}
|
deployment-id: ${{ steps.get_deployments.outputs[0].id }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user