update workflow #18
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 | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: archlinux:latest | |
| permissions: | |
| id-token: write | |
| pages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup | |
| run: | | |
| pacman -Syyu --noconfirm base-devel sudo bash-completion nano git gnupg | |
| useradd -m builder | |
| echo 'builder ALL=NOPASSWD: ALL' >> /etc/sudoers | |
| chown -R builder:builder . | |
| - name: Build | |
| run: | | |
| sudo -u builder bash -c 'source PKGBUILD; for x in ${validpgpkeys[@]}; do gpg --recv-keys $x; done' | |
| sudo -u builder bash -c 'yes | makepkg -s' | |
| - name: Pack | |
| run: | | |
| mkdir -p /tmp/repo/x86_64 | |
| mv *.pkg.tar.zst /tmp/repo/x86_64 | |
| cd /tmp/repo/x86_64 | |
| repo-add openresty.db.tar.zst *.pkg.tar.zst | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: /tmp/repo | |
| - name: Deploy to GitHub Pages | |
| if: github.event.push | |
| uses: actions/deploy-pages@v4 |