tei.su/.github/workflows/publish.yaml

66 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:
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
2024-08-03 06:30:05 +03:00
runs-on: ubuntu-latest
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
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/teidesu/tei.su
tags: type=sha
flavor: latest=true
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
2024-08-04 01:56:50 +03:00
labels: ${{ steps.meta.outputs.labels }}
deploy:
runs-on: ubuntu-latest
needs: publish
steps:
- uses: teidesu/desu-deploy@main
with:
key: ${{ secrets.DEPLOY_KEY }}
server: ${{ secrets.DEPLOY_SERVER }}
wireguard: ${{ secrets.DEPLOY_WG }}
service: teisu