-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (55 loc) · 1.96 KB
/
configure.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Configure and maintain the repo
on: [push]
permissions: write-all
jobs:
configure:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
# by default, it uses a depth of 1
# this fetches all history so that we can read each commit
fetch-depth: 0
ref: ${{ github.head_ref }}
- run: |
echo "REPOSITORY_NAME=$(
echo '${{ github.repository }}' \
| awk -F '/' '{print $2}' \
| tr '-' '_' \
| tr '[:upper:]' '[:lower:]' \
)" >> $GITHUB_ENV
- run: |
echo "REPOSITORY_URLNAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- run: |
echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV
- run: |
if [ "$REPOSITORY_NAME" == "mta_sts_template" ]; then
echo "IS_TEMPLATE=true" >> $GITHUB_ENV
else
echo "IS_TEMPLATE=$(ls .github/template.yml &> /dev/null && echo true || echo false)" >> $GITHUB_ENV
fi
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Test configuration
if: env.IS_TEMPLATE == 'true'
working-directory: bin/
run: |
echo "Repo owner: ${{ env.REPOSITORY_OWNER }}"
echo "Repo name: ${{ env.REPOSITORY_NAME }}"
echo "Repo URL: ${{ env.REPOSITORY_URLNAME }}"
echo "Template: ${{ env.IS_TEMPLATE }}"
python -m pip install -r requirements.txt
export SKIP_TLS_CHECK="False"
export MTASTS_DOMAIN="digital.cabinet-office.gov.uk"
python configure.py
cat ../CNAME
cat ../.well-known/*
- name: Push changes
if: env.IS_TEMPLATE != 'true'
working-directory: bin/
run: |
echo "Would push changes..."