Add refresh cache workflow

This commit is contained in:
Mikołaj Pich 2022-11-21 00:22:58 +01:00
parent 9696056337
commit 200474dabf
4 changed files with 29 additions and 1 deletions

View file

@ -8,6 +8,9 @@ indent_size=4
[*.json]
indent_size=2
[*.yml]
indent_size=2
[*.{kt,kts}]
disabled_rules=import-ordering,no-wildcard-imports
max_line_length=177

20
.github/workflows/refresh-cache.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: Purge cloudflare cache
on: deployment_status
jobs:
publish:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- name: "Call API"
uses: indiesdev/curl@v1.1
with:
method: "POST"
url: https://api.cloudflare.com/client/v4/zones/0dd93531047ba376c2a1167f841c2bfd/purge_cache
headers: ${{ secrets.custom_headers }}
bearer-token: ${{ secrets.bearer_token }}
body: '{"files": ["https://messages.wulkanowy.net.pl/", "https://messages.wulkanowy.net.pl/v1.json"]}'
accept: 200
log-response: false
retries: 3

2
.gitignore vendored
View file

@ -74,3 +74,5 @@ classes
.idea/libraries-with-intellij-classes.xml
dist/
!dist/favicon.ico
.idea/jsonSchemas.xml
.idea/kotlinc.xml

View file

@ -4,8 +4,11 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="corretto-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
@ -16,4 +19,4 @@
</GradleProjectSettings>
</option>
</component>
</project>
</project>