Skip to content

Commit

Permalink
update publish workflow, remove testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanchancey committed Mar 16, 2024
1 parent ccb5278 commit 13bc0b6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 23 deletions.
44 changes: 44 additions & 0 deletions .github/scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM opensuse/tumbleweed

# system upgrade and install ansible dependencies
USER root
RUN zypper ref && zypper dup --no-confirm
RUN zypper install --no-confirm \
git \
ansible \
python311 \
python311-pip \
sudo \
openssh \
gum \
vim

# # solve image-specific dependency problem by replacing busybox-which
RUN zypper install --no-confirm --force-resolution xdg-utils

# add insecure password
RUN echo "root:dotfiles" | chpasswd

# add ansible-user for real-world permissions
RUN useradd -m ansible-user
ENV HOME /home/ansible-user
RUN chown -R ansible-user:ansible-user $HOME

# add ansible user to sudoers file for pipelines
RUN echo "ansible-user ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/ansible-user > /dev/null

# switch to ansible-user
USER ansible-user
ENV USER ansible-user

# copy repo
RUN mkdir $HOME/git
COPY . $HOME/git/dotfiles
WORKDIR $HOME/git/dotfiles

# for gum colors
ENV TERM xterm-256color

RUN ansible-playbook main.yml

CMD /usr/local/bin
20 changes: 0 additions & 20 deletions .github/workflows/docker-build.yml

This file was deleted.

10 changes: 8 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ jobs:
uses: docker/[email protected]
with:
images: ${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
file: ./.github/scripts/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ WORKDIR $HOME/git/dotfiles
# for gum colors
ENV TERM xterm-256color

# RUN git checkout eerie-fog
# ensure scripts are executable
RUN sudo chmod +x dotfiles.sh
RUN sudo chmod +x .github/scripts/prepare

Expand Down

0 comments on commit 13bc0b6

Please sign in to comment.