promote-messy-to-prod #15801
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: promote-messy-to-prod | |
on: | |
schedule: | |
- cron: '35 * * * *' | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
description: 'Dry run' | |
required: false | |
default: 'false' | |
type: choice | |
options: | |
- "true" | |
- "false" | |
auto-merge: | |
description: 'Auto merge' | |
required: false | |
default: 'false' | |
type: choice | |
options: | |
- "true" | |
- "false" | |
push: | |
tags: | |
- 'v*' # Push tags matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
promote-messy-to-prod: | |
name: Promote messy to prod | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
# fetch-depth: 0 needed to get all branches | |
fetch-depth: 0 | |
path: test-deploy | |
token: ${{ secrets.PUSHER_ROBOT_GITHUB_TOKEN }} | |
- name: Set ENV | |
run: | | |
# Generate unique EOF value to prevent injection attack | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "IMAGES<<$EOF" >> $GITHUB_ENV | |
cat .github/config/promote/messy-to-prod.json >> $GITHUB_ENV | |
echo "$EOF" >> $GITHUB_ENV | |
- name: Promote (workflow_dispatch) | |
uses: kustomize-everything/[email protected] | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
target-repo: kustomize-everything/test-deploy | |
target-branch: main | |
working-directory: test-deploy | |
images: ${{ env.IMAGES }} | |
github-token: ${{ secrets.PUSHER_ROBOT_GITHUB_TOKEN }} | |
promotion-method: pull_request | |
dry-run: ${{ inputs.dry-run }} | |
auto-merge: ${{ inputs.auto-merge }} | |
- name: Promote (scheduled) | |
uses: kustomize-everything/[email protected] | |
if: ${{ github.event_name == 'schedule' }} | |
with: | |
target-repo: kustomize-everything/test-deploy | |
target-branch: main | |
working-directory: test-deploy | |
images: ${{ env.IMAGES }} | |
github-token: ${{ secrets.PUSHER_ROBOT_GITHUB_TOKEN }} | |
promotion-method: pull_request | |
dry-run: false | |
auto-merge: false |