multi-scrobbler-now-playing/.gitea/workflows/deploy.yml

56 lines
1.8 KiB
YAML
Raw Normal View History

2025-01-13 23:04:15 +00:00
name: Deploy
on: [push]
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
2025-01-15 00:49:18 +00:00
- name: Checkout
uses: actions/checkout@v3
2025-01-16 00:48:57 +00:00
2025-01-15 01:03:12 +00:00
- name: Docker install
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -yqq ca-certificates curl
2025-01-15 01:03:12 +00:00
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
2025-01-15 01:03:12 +00:00
chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
2025-01-15 01:03:12 +00:00
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -yqq docker-ce docker-ce-cli containerd.io
2025-01-16 00:48:57 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
2025-01-16 00:48:57 +00:00
2025-01-15 00:49:18 +00:00
- name: Docker Login
uses: docker/login-action@v3
with:
registry: git.riksolo.com
username: riksolo
password: ${{secrets.CONTAINER_REGISTRY_TOKEN}}
2025-01-16 00:48:57 +00:00
2025-01-15 00:49:18 +00:00
- name: Set up node
uses: actions/setup-node@v4
2025-01-13 23:04:15 +00:00
with:
node-version: '20.x'
2025-01-16 00:48:57 +00:00
2025-01-13 23:04:15 +00:00
- run: npm i
2025-01-16 00:48:57 +00:00
2025-01-15 00:49:18 +00:00
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
2025-01-16 00:48:57 +00:00
tags: git.riksolo.com/riksolo/multi-scrobbler-now-playing:latest , git.riksolo.com/riksolo/multi-scrobbler-now-playing:${{github.sha}}
- name: Completion webhook
if: ${{always()}}
continue-on-error: true
uses: fjogeleit/http-request-action@v1
with:
url: ${{secrets.NODE_RED_WORKFLOW_COMPLETE_URL}}
data: '{"job": ${{toJSON(job)}}, "gitea": ${{toJSON(gitea)}}}'