CI: tweak zipped update site for convenience #6
This file contains 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 distributions | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Maven 3.9.5 | |
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 | |
with: | |
maven-version: 3.9.5 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B install | |
- name: Upload Update Site | |
uses: actions/upload-artifact@v4 | |
with: | |
name: update-site | |
path: releng/org.eclipse.epsilon.emc.rdf.updatesite/target/repository | |
- name: Deploy Maven artifact | |
run: mvn -B -f pom-plain.xml clean deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
upload-site: | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Download Update Site | |
uses: actions/download-artifact@v4 | |
with: | |
name: update-site | |
path: _site/updates | |
- name: Create Github Pages Index | |
shell: bash | |
run: | | |
echo '<html><body>The <a href="updates">updates</a> folder has the emc-rdf update site.</body></html>' > _site/index.html | |
echo "<html><body>This is an Eclipse update site.</body></html>" > _site/updates/index.html | |
- name: Create Zipped Update Site | |
shell: bash | |
run: | | |
cd _site/updates | |
zip -r ../updates.zip . | |
- name: Upload Github Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |