Create separate deploy job

This commit is contained in:
Marty Oehme 2025-03-06 09:20:54 +01:00
parent 642c363d8d
commit bc5d40f68a
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -94,6 +94,7 @@ jobs:
- name: copy
run: cp -rv added-packages/srcpkgs/* srcpkgs
# TODO: Implement cache?
- name: Prepare masterdir
run: |
chown -R builder:builder . &&
@ -112,6 +113,13 @@ jobs:
- name: Show files
run: sudo -Eu builder common/travis/show_files.sh "$BOOTSTRAP" "$ARCH"
- name: Archive xbps artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.config.arch }}-${{ matrix.config.libc }}
path: |
hostdir/binpkgs/*.xbps
# - name: Compare to previous
# run: sudo -Eu builder common/travis/xpkgdiff.sh "$BOOTSTRAP" "$ARCH"
@ -130,8 +138,41 @@ jobs:
# chown builder:builder /check-install &&
# sudo -Eu builder common/travis/check-install.sh "$BOOTSTRAP" "$ARCH"
deploy:
name: Deploy repository
runs-on: ubuntu-latest
needs: [ build ]
if: "github.ref == 'refs/heads/main' && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')"
container:
image: ghcr.io/void-linux/void-glibc-full:20250227R1
options: --privileged
steps:
- name: Prepare container
run: |
# switch to repo-ci mirror
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
# install dependencies
xbps-install -Syu xbps && xbps-install -yu && xbps-install -y sudo bash curl git git-lfs
# create non-root user
useradd -G xbuilder -M builder
- name: Checkout existing repo
uses: actions/checkout@v4
with:
ref: gh-pages
lfs: true
- uses: actions/download-artifact@v4
with:
pattern: binaries-*
merge-multiple: true
- name: Show downloaded files
run: ls -R .
- name: sign
working-directory: hostdir/binpkgs/
run: |
xbps-rindex -r $PWD
@ -143,13 +184,11 @@ jobs:
xbps-rindex -c $PWD
- name: checksum
working-directory: hostdir/binpkgs/
run: |
for pkg in *.xbps; do sha256sum "$pkg" | tee "$pkg".sha256sum; done
for pkg in *.xbps; do sha512sum "$pkg" | tee "$pkg".sha512sum; done
- name: Create simple index page for repo
working-directory: hostdir/binpkgs/
run: |
echo '<html><head><title>Index of /</title></head> <body><h1>Index of /</h1><hr><pre>' > index.html
for pkg in *.xbps; do echo "<a href=\"${pkg}}\">${pkg}</a>" >> index.html; done
@ -157,10 +196,6 @@ jobs:
- name: publish to pages
uses: peaceiris/actions-gh-pages@v4
# If you're changing the branch from main,
# also change the `main` in `refs/heads/main`
# below accordingly.
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: hostdir/binpkgs
publish_dir: .