tei.su/.forgejo/workflows/publish.yaml

65 lines
1.6 KiB
YAML
Raw Normal View History

2024-08-04 01:56:50 +03:00
name: Publish and deploy
2024-08-03 06:30:05 +03:00
on:
push:
branches: [ main ]
2024-08-04 01:56:50 +03:00
workflow_dispatch:
2025-01-04 02:50:49 +03:00
2024-08-04 01:56:50 +03:00
concurrency:
group: deploy
cancel-in-progress: true
2024-08-03 06:30:05 +03:00
jobs:
2024-08-04 01:56:50 +03:00
publish:
if: github.repository == 'teidesu/tei.su' # do not run on forks
2025-01-04 02:50:49 +03:00
runs-on: docker-dind
2024-08-03 06:30:05 +03:00
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
env:
DONATE_PAGE_DATA: ${{ vars.DONATE_PAGE_DATA }}
run: |
echo "$DONATE_PAGE_DATA" > src/components/pages/PageDonate/data.json
2025-01-04 02:50:49 +03:00
whoami
/opt/setup-dockerd.sh
2024-08-03 06:30:05 +03:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
2025-01-04 02:50:49 +03:00
registry: git.stupid.fish
2024-08-03 06:30:05 +03:00
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
2025-01-04 02:50:49 +03:00
images: git.stupid.fish/teidesu/tei.su
2024-08-03 06:30:05 +03:00
tags: type=sha
flavor: latest=true
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
2024-08-05 00:40:36 +03:00
platforms: linux/amd64
2024-08-03 06:30:05 +03:00
tags: ${{ steps.meta.outputs.tags }}
2024-08-04 01:56:50 +03:00
labels: ${{ steps.meta.outputs.labels }}
deploy:
2025-01-04 02:50:49 +03:00
runs-on: node22
2024-08-04 01:56:50 +03:00
needs: publish
steps:
- uses: teidesu/desu-deploy@main
with:
key: ${{ secrets.DEPLOY_KEY }}
server: ${{ secrets.DEPLOY_SERVER }}
wireguard: ${{ secrets.DEPLOY_WG }}
service: teisu