Files
ivanch.me/.gitea/workflows/test.yaml
Jose Henrique b330959cc5
All checks were successful
Homepage Build and Deploy (Test) / Build Homepage Image (push) Successful in 31s
Homepage Build and Deploy (Test) / Deploy Homepage (push) Successful in 9s
ci: switch workflows to runner-slim-amd64 (new pipeline runner label)
2026-07-13 22:49:52 -03:00

58 lines
1.6 KiB
YAML

name: Homepage Build and Deploy (Test)
on:
push:
branches:
- main
pull_request: {}
workflow_dispatch: {}
env:
REGISTRY_HOST: git.ivanch.me
REGISTRY_USERNAME: ivanch
IMAGE_NAME: ${{ env.REGISTRY_HOST }}/ivanch/mainpage
jobs:
build:
name: Build Homepage Image
runs-on: runner-slim-amd64
outputs:
short_sha: ${{ steps.vars.outputs.short_sha }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Export short commit SHA
id: vars
shell: bash
run: |
echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "sha: ${{ steps.vars.outputs.short_sha }}"
- name: Build and Push Multi-Arch Image
uses: https://git.ivanch.me/ivanch/pipeline-actions/build-and-push@main
with:
image: ${{ env.IMAGE_NAME }}
image_tag: ${{ steps.vars.outputs.short_sha }}
registry_password: ${{ secrets.REGISTRY_PASSWORD }}
ssh_key: ${{ secrets.SSH_KEY_DOCKERBUILD }}
deploy:
name: Deploy Homepage
runs-on: runner-slim-amd64
needs: build
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Recreate Container
uses: https://git.ivanch.me/ivanch/pipeline-actions/ssh-deploy@main
with:
ssh_host: ${{ secrets.HOST }}
ssh_username: ${{ secrets.USERNAME }}
ssh_key: ${{ secrets.KEY }}
ssh_port: ${{ secrets.PORT }}
remote_dir: ${{ secrets.TEST_DIR }}
image: ${{ env.IMAGE_NAME }}
image_tag: ${{ needs.build.outputs.short_sha }}