Create separate deploy job
This commit is contained in:
parent
642c363d8d
commit
bc5d40f68a
1 changed files with 43 additions and 8 deletions
51
.github/workflows/build.yaml
vendored
51
.github/workflows/build.yaml
vendored
|
@ -94,6 +94,7 @@ jobs:
|
||||||
- name: copy
|
- name: copy
|
||||||
run: cp -rv added-packages/srcpkgs/* srcpkgs
|
run: cp -rv added-packages/srcpkgs/* srcpkgs
|
||||||
|
|
||||||
|
# TODO: Implement cache?
|
||||||
- name: Prepare masterdir
|
- name: Prepare masterdir
|
||||||
run: |
|
run: |
|
||||||
chown -R builder:builder . &&
|
chown -R builder:builder . &&
|
||||||
|
@ -112,6 +113,13 @@ jobs:
|
||||||
- name: Show files
|
- name: Show files
|
||||||
run: sudo -Eu builder common/travis/show_files.sh "$BOOTSTRAP" "$ARCH"
|
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
|
# - name: Compare to previous
|
||||||
# run: sudo -Eu builder common/travis/xpkgdiff.sh "$BOOTSTRAP" "$ARCH"
|
# run: sudo -Eu builder common/travis/xpkgdiff.sh "$BOOTSTRAP" "$ARCH"
|
||||||
|
|
||||||
|
@ -130,8 +138,41 @@ jobs:
|
||||||
# chown builder:builder /check-install &&
|
# chown builder:builder /check-install &&
|
||||||
# sudo -Eu builder common/travis/check-install.sh "$BOOTSTRAP" "$ARCH"
|
# 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
|
- name: sign
|
||||||
working-directory: hostdir/binpkgs/
|
|
||||||
run: |
|
run: |
|
||||||
xbps-rindex -r $PWD
|
xbps-rindex -r $PWD
|
||||||
|
|
||||||
|
@ -143,13 +184,11 @@ jobs:
|
||||||
xbps-rindex -c $PWD
|
xbps-rindex -c $PWD
|
||||||
|
|
||||||
- name: checksum
|
- name: checksum
|
||||||
working-directory: hostdir/binpkgs/
|
|
||||||
run: |
|
run: |
|
||||||
for pkg in *.xbps; do sha256sum "$pkg" | tee "$pkg".sha256sum; done
|
for pkg in *.xbps; do sha256sum "$pkg" | tee "$pkg".sha256sum; done
|
||||||
for pkg in *.xbps; do sha512sum "$pkg" | tee "$pkg".sha512sum; done
|
for pkg in *.xbps; do sha512sum "$pkg" | tee "$pkg".sha512sum; done
|
||||||
|
|
||||||
- name: Create simple index page for repo
|
- name: Create simple index page for repo
|
||||||
working-directory: hostdir/binpkgs/
|
|
||||||
run: |
|
run: |
|
||||||
echo '<html><head><title>Index of /</title></head> <body><h1>Index of /</h1><hr><pre>' > index.html
|
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
|
for pkg in *.xbps; do echo "<a href=\"${pkg}}\">${pkg}</a>" >> index.html; done
|
||||||
|
@ -157,10 +196,6 @@ jobs:
|
||||||
|
|
||||||
- name: publish to pages
|
- name: publish to pages
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
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:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: hostdir/binpkgs
|
publish_dir: .
|
||||||
|
|
Loading…
Reference in a new issue