-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (47 loc) · 1.42 KB
/
janitor.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
44
45
46
47
48
49
50
51
52
name: Janitor
on:
push:
branches:
- "develop"
jobs:
branch:
name: Find branch name
runs-on: ubuntu-latest
outputs:
branchname: ${{ steps.branch.outputs.BRANCH_TO_DELETE }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Get branch name and delete merged feature branches
id: branch
run: ./.github/scripts/clean-merged-branches.sh
build:
needs: branch
name: Storage container cleanup
if: ${{ needs.branch.outputs.branchname }}
runs-on: ubuntu-latest
strategy:
matrix:
brand: ["payex", "swedbankpay"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
# Set brand specific variables
- name: Environment variables
id: variables
run: ./.github/scripts/variables.sh --brand ${{ matrix.brand }} --ref ${{ github.ref }}
- name: Azure Login
uses: azure/login@v2.2.0
with:
creds: ${{ secrets.AZURE_CREDENTIALS_STAGE }}
- name: Delete feature folders
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob delete-batch -s "\$web" --pattern ${{ needs.branch.outputs.branchname }}/** --account-name ${{ steps.variables.outputs.AZURE_ACCOUNT_STAGE }}