Skip to content

Commit 1256b08

Browse files
committed
feat: container
1 parent 4eff9b4 commit 1256b08

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build Docker image and push to GitHub Container Registry
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v1
9+
- name: Publish to GitHub Package Registry
10+
uses: elgohr/Publish-Docker-Github-Action@master
11+
with:
12+
name: vtluug/site
13+
username: vtluug
14+
password: ${{ secrets.GITHUB_TOKEN }}
15+
registry: ghcr.io
16+
tag_names: true

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM nginx:alpine
2+
3+
RUN apk add --no-cache git busybox
4+
5+
# shithack. i'm lazy. ~rsk
6+
RUN rm -rf /usr/share/nginx/html/*
7+
RUN git clone https://github.com/vtluug/vtluug.github.io /usr/share/nginx/html
8+
RUN git config --global --add safe.directory /usr/share/nginx/html
9+
RUN chown -R nginx:nginx /usr/share/nginx/html
10+
11+
# gh doesn't ratelimit
12+
RUN echo "* * * * * git -C /usr/share/nginx/html pull origin master >> /var/log/pull 2>&1" >> /etc/crontabs/root
13+
14+
EXPOSE 80
15+
CMD ["sh", "-c", "crond -b -L /var/log/cron && nginx -g 'daemon off;'"]

0 commit comments

Comments
 (0)