Files
projectorpi-web/.gitea/workflows/release-tag.yml
Marijn Doeve 1c7b246252
Some checks failed
release-tag / release-image (push) Failing after 3m56s
New Rust
2024-07-01 21:56:06 +02:00

73 lines
2.3 KiB
YAML

name: release-tag
on:
push:
tags:
- "*"
jobs:
release-image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
env:
DOCKER_LATEST: latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # all history for all branches and tags
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v2
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: gitea.marijndoeve.nl
username: ${{ gitea.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Get Meta
id: meta
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
env:
ACTIONS_RUNTIME_TOKEN: "" # See https://gitea.com/gitea/act_runner/issues/119
IMAGE_NAME: gitea.marijndoeve.nl/marijn/${{ steps.meta.outputs.REPO_NAME }}
with:
context: .
file: ./Containerfile
platforms: |
linux/arm/v7
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
${{ env.IMAGE_NAME }}:${{ env.DOCKER_LATEST }}
# cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:${{ env.DOCKER_LATEST }}
# cache-to: type:inline
# cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
# cache-to: type=registry,ref=${{ env.IMAGE_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: ${{ vars.HOST }}
username: ${{ vars.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ vars.PORT }}
script: |
cd /opt/projectorpi-web
${{ env.DOCKER_COMPOSE }} pull
${{ env.DOCKER_COMPOSE }} up -d