-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI/CD files for building the plugin
* Build and publish the base arch linux image every midnight * Build the plugin on every PR and push to main, and every night at 2AM
- Loading branch information
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM archlinux:latest | ||
|
||
# Update the package repositories and install sudo | ||
RUN pacman -Syu --noconfirm --needed sudo git base-devel | ||
|
||
# Create a new user | ||
RUN useradd -m user && \ | ||
passwd -d user && \ | ||
printf 'user ALL=(ALL) ALL\n' | tee -a /etc/sudoers | ||
|
||
# Switch to the new user so makepkg doesn't run as root | ||
USER user | ||
WORKDIR /home/user | ||
|
||
# Install paru package manager | ||
RUN git clone https://aur.archlinux.org/paru.git && \ | ||
cd paru && \ | ||
makepkg -si --noconfirm | ||
|
||
WORKDIR /app | ||
|
||
USER root | ||
|
||
# Define the command to run your application | ||
CMD ["/bin/bash"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
schedule: | ||
# run every night at midnight | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: .github/Dockerfile | ||
push: true | ||
tags: duckonaut/hyprland-arch:latest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
# run every night at 2AM (the base docker image is updated at midnight) | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
# image built from the Dockerfile in the .github/ folder | ||
image: duckonaut/hyprland-arch:latest | ||
steps: | ||
- name: Install dependencies | ||
# TODO: remove hyprwayland-scanner-git once hyprland-git properly depends on it | ||
run: | | ||
sudo -u user sh -c "paru -Syu --noconfirm hyprwayland-scanner-git hyprland-git" | ||
- name: Checkout current repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build current repository | ||
run: | | ||
meson setup build --wipe | ||
ninja -C build |