chore: add ssh key #134
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 | |
on: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
container: | |
image: archlinux:latest | |
env: | |
makepkg_flags: "-f" | |
pkgsdir: "/home/nonroot/pkgs" | |
steps: | |
- name: Install latest git | |
run: | | |
pacman -Syy --noconfirm git | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Create non_root user | |
run: | | |
useradd nonroot && mkdir /home/nonroot && chown -R nonroot:nonroot /home/nonroot | |
- name: Set nonroot user in sudoers | |
run: | | |
echo 'nonroot ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | |
- name: Set root user in sudoers | |
run: | | |
echo 'root ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | |
- name: Enable multilib | |
run: | | |
echo -e '[multilib]\nInclude = /etc/pacman.d/mirrorlist\n' >> /etc/pacman.conf | |
- name: Enable extra | |
run: | | |
sed -i '/^#\[extra\]/{N;s/#//g}' /etc/pacman.conf | |
- name: Install dependencies | |
run: | | |
pacman -Syyu --noconfirm && pacman -S --noconfirm just base-devel sudo xorgproto openssh | |
- name: Set source permissions | |
run: | | |
chown -R nonroot:nonroot . | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Build packages | |
run: | | |
echo $SSH_AGENT_PID | |
sudo -u nonroot just makepkg_flags=$makepkg_flags all | |
- name: Show sedspkg diff | |
run: | | |
cd $pkgsdir | |
sudo -u nonroot git diff | |
- name: Commit and release | |
run: | | |
sudo -u nonroot just push-packages |