|
1 | 1 | name: CI |
2 | 2 |
|
3 | | -# Reference documentation: https://docs.github.com/en/actions/reference |
4 | | - |
5 | | -# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags |
6 | 3 | on: |
7 | 4 | push: |
8 | 5 | branches: [pl-wcag-22-nowe] |
9 | | - # Allows you to run this workflow manually from the Actions tab |
10 | 6 | workflow_dispatch: |
11 | | - |
12 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 7 | + |
13 | 8 | permissions: |
14 | | - contents: write |
| 9 | + contents: read |
| 10 | + pages: write |
| 11 | + id-token: write |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: pages |
| 15 | + cancel-in-progress: false |
15 | 16 |
|
16 | 17 | jobs: |
17 | | - main: |
18 | | - name: deploy |
| 18 | + build: |
| 19 | + name: Build pages |
19 | 20 | runs-on: ubuntu-24.04 |
20 | | - env: |
21 | | - GH_REF: github.com/irdpl/wcag.git |
| 21 | + |
22 | 22 | steps: |
23 | | - - name: Checkout the repository |
| 23 | + - name: Checkout repository |
24 | 24 | uses: actions/checkout@v4 |
| 25 | + |
25 | 26 | - name: Setup Java |
26 | | - # see https://github.com/actions/setup-java#supported-distributions |
27 | | - # note that this also deploys ant |
28 | 27 | uses: actions/setup-java@v4 |
29 | 28 | with: |
30 | | - distribution: 'adopt' |
| 29 | + distribution: adopt |
31 | 30 | java-version: '11' |
32 | | - - name: before_install |
| 31 | + |
| 32 | + - name: Install Ant |
33 | 33 | run: | |
34 | 34 | tar -xzvf lib/apache-ant-1.10.6-bin.tar.gz |
35 | | - export PATH=`pwd`/apache-ant-1.10.6/bin:$PATH |
36 | | - - name: script |
| 35 | + echo "$(pwd)/apache-ant-1.10.6/bin" >> $GITHUB_PATH |
| 36 | +
|
| 37 | + - name: Build site |
37 | 38 | run: | |
38 | | - mkdir output |
| 39 | + mkdir -p output |
39 | 40 | git clone --depth=1 --branch=gh-pages https://github.com/irdpl/wcag.git output |
40 | | - curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githack.com/irdpl/wcag/pl-wcag-22-nowe/guidelines/index.html -o output/guidelines/22/index.html -f --retry 3 |
41 | | - curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githack.com/irdpl/wcag/pl-wcag-22-nowe/requirements/22/index.html -o output/requirements/22/index.html -f --retry 3 |
42 | | - curl https://www.w3.org/publications/spec-generator/?type=respec"&"url=https://raw.githack.com/irdpl/wcag/pl-wcag-22-nowe/conformance-challenges/index.html -o output/conformance-challenges/index.html -f --retry 3 |
| 41 | +
|
| 42 | + curl -f --retry 3 \ |
| 43 | + "https://www.w3.org/publications/spec-generator/?type=respec&url=https://raw.githack.com/irdpl/wcag/pl-wcag-22-nowe/guidelines/index.html" \ |
| 44 | + -o output/guidelines/22/index.html |
| 45 | +
|
| 46 | + curl -f --retry 3 \ |
| 47 | + "https://www.w3.org/publications/spec-generator/?type=respec&url=https://raw.githack.com/irdpl/wcag/pl-wcag-22-nowe/requirements/22/index.html" \ |
| 48 | + -o output/requirements/22/index.html |
| 49 | +
|
| 50 | + curl -f --retry 3 \ |
| 51 | + "https://www.w3.org/publications/spec-generator/?type=respec&url=https://raw.githack.com/irdpl/wcag/pl-wcag-22-nowe/conformance-challenges/index.html" \ |
| 52 | + -o output/conformance-challenges/index.html |
| 53 | +
|
43 | 54 | ant deploy |
44 | 55 |
|
45 | | - - name: Upload Artifact |
46 | | - #if: failure() # Upload artifact only if the previous step (Build) fails |
47 | | - uses: actions/upload-artifact@v4 |
| 56 | + - name: Upload Pages artifact |
| 57 | + uses: actions/upload-pages-artifact@v3 |
48 | 58 | with: |
49 | | - name: failed-artifact |
50 | | - path: | |
51 | | - ./output |
| 59 | + path: ./output |
52 | 60 |
|
| 61 | + deploy: |
| 62 | + name: Deploy to GitHub Pages |
| 63 | + needs: build |
| 64 | + runs-on: ubuntu-24.04 |
| 65 | + environment: |
| 66 | + name: github-pages |
| 67 | + url: ${{ steps.deployment.outputs.page_url }} |
| 68 | + |
| 69 | + steps: |
53 | 70 | - name: Deploy |
54 | | - uses: peaceiris/actions-gh-pages@v3 |
55 | | - with: |
56 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
57 | | - publish_dir: ./output |
58 | | - cname: wcag.irdpl.pl |
| 71 | + id: deployment |
| 72 | + uses: actions/deploy-pages@v4 |
0 commit comments