diff --git a/.gitea/workflows/release-nightly.yml b/.gitea/workflows/release-nightly.yml index 0cfbd0c..f2393e2 100644 --- a/.gitea/workflows/release-nightly.yml +++ b/.gitea/workflows/release-nightly.yml @@ -10,7 +10,6 @@ jobs: container: image: catthehacker/ubuntu:act-latest env: - DOCKER_ORG: gitea DOCKER_LATEST: nightly steps: - name: Checkout @@ -44,8 +43,9 @@ jobs: context: . file: ./Containerfile platforms: | - linux/amd64 linux/arm/v7 push: true tags: | gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }} + cache-from: type=registry,ref=gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}:buildcache + cache-to: type=registry,ref=gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}:buildcache,mode=max diff --git a/.gitea/workflows/release-tag.yml b/.gitea/workflows/release-tag.yml index 56d233e..7d13cab 100644 --- a/.gitea/workflows/release-tag.yml +++ b/.gitea/workflows/release-tag.yml @@ -11,7 +11,6 @@ jobs: container: image: catthehacker/ubuntu:act-latest env: - DOCKER_ORG: marijn DOCKER_LATEST: latest steps: - name: Checkout @@ -46,9 +45,25 @@ jobs: context: . file: ./Containerfile platforms: | - linux/arm64 linux/arm/v7 push: true tags: | gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }} + cache-from: type=registry,ref=gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}:buildcache + cache-to: type=registry,ref=gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}:buildcache,mode=max + + - name: Deploy Image to Sever + id: deploy + env: + DOCKER_COMPOSE: IMAGE_TAG=${{ gitea.ref_name }} docker compose --ansi=never -f=compose.yaml -f=compose.prod.yaml + uses: https://github.com/appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: | + cd /opt/projectorpi-web + ${{ env.DOCKER_COMPOSE }} pull + ${{ env.DOCKER_COMPOSE }} up -d diff --git a/Containerfile b/Containerfile index c9e55c7..928ba5b 100644 --- a/Containerfile +++ b/Containerfile @@ -13,8 +13,8 @@ FROM base as prod ADD requirements.txt ./ RUN apt-get update && apt-get install -y build-essential \ - && pip install --upgrade pip \ - && pip3 install -r requirements.txt \ + && pip3 install --no-cache --upgrade pip \ + && pip3 install --no-cache -r requirements.txt \ && apt-get remove -y build-essential ADD projectorpi_web/* ./ diff --git a/compose.prod.yaml b/compose.prod.yaml index a7ae4c9..daf5740 100644 --- a/compose.prod.yaml +++ b/compose.prod.yaml @@ -1,3 +1,3 @@ services: app: - image: gitea.marijndoeve.nl/marijn/projectorpi-web:${IMAGE_TAG:-nightly} + image: gitea.marijndoeve.nl/marijn/projectorpi-web:${IMAGE_TAG:-latest}