65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: fkirc/skip-duplicate-actions@master
|
|
- uses: actions/checkout@v3
|
|
- uses: gradle/wrapper-validation-action@v1
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 11
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
|
|
- name: Generate messages
|
|
run: ./gradlew run
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
path: ./dist
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
pages: write
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1
|
|
|
|
purge-cache:
|
|
runs-on: ubuntu-latest
|
|
needs: deploy
|
|
steps:
|
|
- name: "Call Cloudflare API"
|
|
uses: indiesdev/curl@v1
|
|
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", "https://messages.wulkanowy.net.pl/mapping1.json", "https://messages.wulkanowy.net.pl/mapping2.json", "https://messages.wulkanowy.net.pl/mapping3.json", "https://messages.wulkanowy.net.pl/end.json"]}'
|
|
accept: 200
|
|
log-response: false
|
|
retries: 3
|