25 lines
780 B
YAML
25 lines
780 B
YAML
name: Deploy to staging
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
job_name:
|
|
description: "Job name that has completed"
|
|
required: true
|
|
type: string
|
|
rev:
|
|
description: "Revision of succeeded comit"
|
|
required: true
|
|
type: string
|
|
jobs:
|
|
deploy:
|
|
name: Deploy to staging
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: |
|
|
git tag --list | grep ${{ inputs.job_name }} || (git tag ${{ inputs.job_name }} ${{ inputs.rev }} && git push --tags)
|
|
git fetch --all --tags
|
|
if [[ ! git merge-base --is-ancestor ${{ inputs.rev }} ${{ inputs.job_name }} ]]; then
|
|
git tag -f ${{ inputs.job_name }} ${{ inputs.rev }}
|
|
git push --tags --force
|
|
fi
|