-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (37 loc) · 1.1 KB
/
preview_cleanup.yml
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
name: Clean Previews
on:
# __TEMPLATE_UPDATE__: Uncomment schedule section and remove empty array
[]
# schedule:
# - cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}
jobs:
cleanup:
name: Clean Previews
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
lfs: true
- 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/mproductna preview:cleanup
env:
ANSIBLE_VAULT_PASSWORD_FILE: .infra/.vault_pwd.txt
ANSIBLE_REMOTE_USER: deploy
ANSIBLE_BECOME_PASS: ${{ secrets.DEPLOY_PASS }}