First version of the website. (#5) #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Archive | |
| on: | |
| push: | |
| tags: v* | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build_website: | |
| name: Build and Archive | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Go | |
| uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 | |
| with: | |
| go-version: ">=1.21.5" | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0 | |
| with: | |
| hugo-version: "0.144.2" | |
| extended: true | |
| - uses: actions/cache@v4 | |
| with: | |
| path: /tmp/hugo_cache | |
| key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-hugomod- | |
| - name: Build S-CORE Hugo Website | |
| shell: bash | |
| run: | | |
| mkdir -p themes/hugo-solstice-theme | |
| hugo --minify -b 'https://eclipse.dev/score/' | |
| - name: Archive | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: website | |
| path: ./public | |
| main_publish: | |
| if: github.ref == 'refs/heads/main' | |
| name: Archive and Published Builds on main | |
| runs-on: ubuntu-latest | |
| needs: [ build_website ] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| repository: 'eclipse-score/eclipse-score-website-published' | |
| - name: Download Artifact | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: website | |
| - name: Push changes | |
| uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3 | |
| with: | |
| folder: . | |
| branch: main | |
| git-config-name: "score Bot [bot]" | |
| git-config-email: "score-actions[bot]@users.noreply.github.com" | |
| repository-name: "eclipse-score/eclipse-score-website-published" | |
| commit-message: "Website build ${{ github.workflow }}-${{ github.run_number }}" | |
| token: ${{ secrets.GH_PUBLISH_TOKEN }} | |
| create_release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| name: Archive and Published Tagged Build | |
| runs-on: ubuntu-latest | |
| needs: [ build_website ] | |
| steps: | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: false | |
| prerelease: false | |
| if: startsWith(github.ref, 'refs/tags/') | |
| - name: Download Artifact | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: website | |
| - name: Upload Release Asset | |
| id: upload-release-asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./website | |
| asset_name: website.zip | |
| asset_content_type: application/zip | |
| if: startsWith(github.ref, 'refs/tags/') |