Skip to content

chore: add ssh key #139

chore: add ssh key

chore: add ssh key #139

Workflow file for this run

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: |
sudo -E -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