Skip to content

update_templates

update_templates #93

name: update_templates
on:
workflow_dispatch:
inputs:
version:
description: 'topaz version'
type: string
default: "main"
required: false
env:
VAULT_ADDR: https://vault.eng.aserto.com/
jobs:
update:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
-
name: Read Configuration
uses: hashicorp/vault-action@v2
id: vault
with:
url: https://vault.eng.aserto.com/
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY;
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
- name: Setup git
run: |
mkdir -p $HOME/.ssh
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa
ssh-keyscan github.com >> $HOME/.ssh/known_hosts
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global user.email "[email protected]"
git config --global user.name "Aserto Bot"
- name: Get topaz
uses: actions/checkout@v4
with:
repository: "aserto-dev/topaz"
ref: ${{ inputs.version }}
path: "./topaz"
token: ${READ_WRITE_TOKEN}
- name: Copy assets
run: |
cp -r ./topaz/assets/* static/assets/templates/
rm static/assets/templates/*.gif
rm -rf ./topaz
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
new_branch: update_topaz_templates
message: Update static topaz template assets
- name: Prepare PR
run: gh pr create -H update_topaz_templates -B main --title 'Update topaz templates' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.READ_WRITE_TOKEN }}