Skip to content

.github/workflows/preview_cleanup.yml #63

.github/workflows/preview_cleanup.yml

.github/workflows/preview_cleanup.yml #63

name: Clean Previews
on:
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}
jobs:
cleanup:
name: Clean Previews
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
name: github_actions
key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
config: |
Host *
IdentityFile ~/.ssh/github_actions
- name: Create vault pwd file
run: echo ${{ secrets.VAULT_PWD }} > .infra/.vault_pwd.txt
- name: Install jmespath
run: |
sudo pipx inject ansible-core jmespath
- name: Run playbook
run: .bin/mna-bal preview:cleanup
env:
ANSIBLE_VAULT_PASSWORD_FILE: .infra/.vault_pwd.txt
ANSIBLE_REMOTE_USER: ${{ secrets.DEPLOY_USERNAME }}
ANSIBLE_BECOME_PASS: ${{ secrets.DEPLOY_PASS }}