chore: fix ci
This commit is contained in:
parent
d807a0407f
commit
6176227dfa
45
.github/workflows/ci.yml
vendored
Normal file
45
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# https://hexo.io/docs/github-pages.html
|
||||||
|
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
buildAndPush:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# - name: Set up QEMU
|
||||||
|
# uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ghcr.io/uetchy/uechi.io:latest
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|
||||||
|
- name: Trigger Watchtower Update
|
||||||
|
run: |
|
||||||
|
curl -s -H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" https://watchtower.uechi.dev/v1/update
|
75
.github/workflows/docker.yml
vendored
75
.github/workflows/docker.yml
vendored
@ -1,75 +0,0 @@
|
|||||||
# https://hexo.io/docs/github-pages.html
|
|
||||||
name: Docker
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildAndPush:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
|
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-buildx-
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
tags: ghcr.io/uetchy/uechi.io:latest
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
||||||
|
|
||||||
- name: Cache deps stage
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
target: deps
|
|
||||||
tags: deps_stage
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
||||||
|
|
||||||
- name: Cache build stage
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
target: build
|
|
||||||
tags: build_stage
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
||||||
|
|
||||||
- name: Image digest
|
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
||||||
|
|
||||||
- name: Trigger Watchtower Update
|
|
||||||
run: |
|
|
||||||
curl -s -H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" https://watchtower.uechi.dev/v1/update
|
|
||||||
|
|
||||||
# Temp fix
|
|
||||||
# https://github.com/docker/build-push-action/issues/252
|
|
||||||
# https://github.com/moby/buildkit/issues/1896
|
|
||||||
- name: Move cache
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/.buildx-cache
|
|
||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
@ -1,14 +1,12 @@
|
|||||||
FROM node:15 as deps
|
FROM node:15 as build
|
||||||
|
|
||||||
# https://github.com/jgm/pandoc/releases
|
# https://github.com/jgm/pandoc/releases
|
||||||
RUN curl -LO https://github.com/jgm/pandoc/releases/download/2.14.0.1/pandoc-2.14.0.1-1-amd64.deb
|
RUN curl -LO https://github.com/jgm/pandoc/releases/download/2.14.0.1/pandoc-2.14.0.1-1-amd64.deb
|
||||||
RUN dpkg -i pandoc-2.14.0.1-1-amd64.deb
|
RUN dpkg -i pandoc-2.14.0.1-1-amd64.deb
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json /app
|
COPY package.json yarn.lock /app/
|
||||||
RUN yarn install
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
FROM deps as build
|
|
||||||
|
|
||||||
COPY themes /app/themes
|
COPY themes /app/themes
|
||||||
COPY source /app/source
|
COPY source /app/source
|
||||||
|
@ -252,6 +252,14 @@ on the host machine:
|
|||||||
ssh-copy-id <user>@<ip>
|
ssh-copy-id <user>@<ip>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```bash:$HOME/.ssh/rc
|
||||||
|
if [ ! -S ~/.ssh/ssh_auth_sock ] && [ -S "$SSH_AUTH_SOCK" ]; then
|
||||||
|
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
See also: [Happy ssh agent forwarding for tmux/screen · Reboot and Shine](https://werat.dev/blog/happy-ssh-agent-forwarding/)
|
||||||
|
|
||||||
## AUR
|
## AUR
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -568,19 +576,19 @@ restic backup --tag system -v \
|
|||||||
--exclude /var/lib/docker/overlay2 \
|
--exclude /var/lib/docker/overlay2 \
|
||||||
/ /boot
|
/ /boot
|
||||||
|
|
||||||
# ftl
|
|
||||||
restic backup --tag ftl -v \
|
|
||||||
/mnt/ftl
|
|
||||||
|
|
||||||
# data
|
# data
|
||||||
restic backup --tag data -v \
|
restic backup --tag data -v \
|
||||||
--exclude 'appdata_*/preview' \
|
--exclude 'appdata_*/preview' \
|
||||||
--exclude 'appdata_*/dav-photocache' \
|
--exclude 'appdata_*/dav-photocache' \
|
||||||
/mnt/data
|
/mnt/data
|
||||||
|
|
||||||
|
# prune
|
||||||
restic forget --prune --group-by tags \
|
restic forget --prune --group-by tags \
|
||||||
--keep-daily 7 --keep-weekly 3 --keep-monthly 3
|
--keep-within-daily 7d \
|
||||||
|
--keep-within-weekly 1m \
|
||||||
|
--keep-within-monthly 3m
|
||||||
|
|
||||||
|
# verify
|
||||||
restic check
|
restic check
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user