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=' - name: Build and push run: | buildctl build \ --frontend dockerfile.v0 \ --local context=. \ --local 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@d373e8ab554a95d222e3ced87e751dabbd3cfc57 with: key: ${{ secrets.DESU_DEPLOY_KEY }} server: ${{ secrets.KOI_IP }} service: teisu