frontend/.gitea/workflows/deploy.yml

43 lines
1.2 KiB
YAML

name: Build and Deploy
on:
push:
branches:
- "master"
paths-ignore:
- "**.md"
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: https://github.com/actions/cache@v3
with:
path: |
/tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ gitea.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: nerdcult_frontend:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Rotate the cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Deploy
env:
TOWER_TOKEN: ${{ secrets.WatchtowerToken}}
TOWER_URI: ${{ secrets.WatchtowerURI}}
run: |
curl -H "Authorization: Bearer $TOWER_TOKEN" $TOWER_URI