Skip to content

Commit

Permalink
Use github pages instead of releases for hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Jun 5, 2024
1 parent 0d12bb0 commit 20ffb2b
Showing 1 changed file with 34 additions and 19 deletions.
53 changes: 34 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
repository_dispatch:
types: [run_build]

permissions:
contents: read
pages: write
id-token: write

jobs:
prepare_jobs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -51,39 +56,49 @@ jobs:
name: artifact-${{ env.PACKAGE }}
path: ${{ env.PACKAGE }}/*.pkg.tar.gz

create_release:
create_repo:
if: contains(github.ref,'refs/heads/master')
needs: [prepare_jobs, build]
runs-on: ubuntu-latest
container: ghcr.io/pspdev/pspsdk:latest

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Install dependencies
run: |
apk --update add build-base bash gpgme-dev libarchive-tools libarchive-dev libtool doxygen libcrypto3
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create repo files
if: contains(github.ref,'refs/heads/master')
run: |
mkdir package
cp artifact-*/*.pkg.tar.gz package/
cd package
mkdir repo
cp artifact-*/*.pkg.tar.gz repo/
cd repo
${PSPDEV}/share/pacman/bin/repo-add pspdev.db.tar.gz *.pkg.tar.gz
- name: Upload files
if: contains(github.ref,'refs/heads/master')
uses: svenstaro/upload-release-action@v2
mv pspdev.db.tar.gz pspdev.db
mv pspdev.files.tar.gz pspdev.files
tar -cvf ../repo.tar ./*
- name: Upload repo artifact
uses: actions/upload-artifact@v4
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: package/*
overwrite: true
file_glob: true
tag: ${{ github.ref }}-${{ github.run_id }}
release_name: ${{ github.ref }} (${{ github.run_id }})
name: github-pages
path: repo.tar

upload_repo:
if: contains(github.ref,'refs/heads/master')
needs: [create_repo]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

docker-layer:
if: contains(github.ref,'refs/heads/master')
needs: [create_release]
needs: [upload_repo]

runs-on: ubuntu-latest

Expand Down

0 comments on commit 20ffb2b

Please sign in to comment.