tei.su/.forgejo/workflows/publish.yaml
alina sireneva 090d1f7c54
Some checks failed
Publish and deploy / publish (push) Failing after 4s
Publish and deploy / deploy (push) Has been skipped
ci: migrate to buildkit
2025-01-16 03:24:54 +03:00

57 lines
No EOL
1.5 KiB
YAML

name: Publish and deploy
on:
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: deploy
cancel-in-progress: true
jobs:
publish:
if: github.repository == 'teidesu/tei.su' # do not run on forks
runs-on: buildkit
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: Login to GitHub Container Registry
run: /opt/registry-login.sh git.stupid.fish "${{ github.actor }}" "${{ secrets.PACKAGES_PAT }}"
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: git.stupid.fish/teidesu/tei.su
tags: type=sha
flavor: latest=true
sep-tags: ','
- name: Build and push
run: |
buildctl build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=./Dockerfile \
--opt platform=amd64 \
--output type=image,oci-mediatypes=true,compression=zstd,rewrite-timestamp=true,push=true,name="${{ steps.meta.outputs.tags }}"
deploy:
runs-on: node22
needs: publish
steps:
- uses: https://github.com/teidesu/desu-deploy@main
with:
key: ${{ secrets.DESU_DEPLOY_KEY }}
server: ${{ secrets.KOI_IP }}
service: teisu