-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.66 KB
/
main-deploy.yml
File metadata and controls
53 lines (45 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Trigger All Workflows
on:
workflow_dispatch:
inputs:
branchOrCommit:
description: 'Branch or commit SHA to deploy'
required: false
type: string
default: 'master'
skipDeploy:
description: 'Skip deployment to ECS'
required: false
type: boolean
default: false
permissions:
id-token: write
contents: write
actions: write
jobs:
trigger:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout prod branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.branchOrCommit }}
- name: Get checked out commit SHA
id: commit
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Create and push new date-based tag
run: |
echo ${{ steps.commit.outputs.sha }}
export TZ="America/New_York"
tag_name="deploy-$(date +"%Y-%m-%d_%H-%M-%S")"
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag "$tag_name" ${{ steps.commit.outputs.sha }}
git push origin "$tag_name"
- name: Trigger Workflow 1
run: |
gh workflow run deploytest.yml --ref master --field skipDeploy=${{ inputs.skipDeploy }} --field branchOrCommit=${{ steps.commit.outputs.sha }}
gh workflow run deploytest.yml --ref master --field skipDeploy=${{ inputs.skipDeploy }} --field branchOrCommit=${{ steps.commit.outputs.sha }}
gh workflow run deploytest.yml --ref master --field skipDeploy=${{ inputs.skipDeploy }} --field branchOrCommit=${{ steps.commit.outputs.sha }}