new test pipe
Some checks failed
Homepage Build and Deploy / Deploy Homepage (push) Has been cancelled
Homepage Build and Deploy / Build Homepage Image (push) Has been cancelled
(Matrix) Homepage Build and Deploy / Build Homepage Image (arm64) (push) Failing after 1m30s
(Matrix) Homepage Build and Deploy / Deploy Homepage (push) Successful in 1m3s
(Matrix) Homepage Build and Deploy / Build Homepage Image (amd64) (push) Failing after 1m29s
(Matrix) Homepage Build and Deploy / create-manifest (push) Has been skipped
Some checks failed
Homepage Build and Deploy / Deploy Homepage (push) Has been cancelled
Homepage Build and Deploy / Build Homepage Image (push) Has been cancelled
(Matrix) Homepage Build and Deploy / Build Homepage Image (arm64) (push) Failing after 1m30s
(Matrix) Homepage Build and Deploy / Deploy Homepage (push) Successful in 1m3s
(Matrix) Homepage Build and Deploy / Build Homepage Image (amd64) (push) Failing after 1m29s
(Matrix) Homepage Build and Deploy / create-manifest (push) Has been skipped
This commit is contained in:
85
.gitea/workflows/matrix.yaml
Normal file
85
.gitea/workflows/matrix.yaml
Normal file
@@ -0,0 +1,85 @@
|
||||
name: (Matrix) Homepage Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY_HOST: git.ivanch.me
|
||||
REGISTRY_USERNAME: ivanch
|
||||
IMAGE_NAME: ${{ env.REGISTRY_HOST }}/ivanch/mainpage
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: linux/amd64
|
||||
runner: ubuntu-slim
|
||||
arch: amd64
|
||||
- platform: linux/arm64
|
||||
runner: ubuntu-arm64 # Your ARM64 runner label
|
||||
arch: arm64
|
||||
runs-on: ${{ matrix.runner }}
|
||||
name: Build Homepage Image (${{ matrix.arch }})
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Container Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" \
|
||||
| docker login "${{ env.REGISTRY_HOST }}" \
|
||||
-u "${{ env.REGISTRY_USERNAME }}" \
|
||||
--password-stdin
|
||||
|
||||
- name: Build and Push Multi-Arch Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
platforms: ${{ matrix.platform }}
|
||||
tags: |
|
||||
${{ env.IMAGE_NAME }}:${{ matrix.arch }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
create-manifest:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Log in to Container Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" \
|
||||
| docker login "${{ env.REGISTRY_HOST }}" \
|
||||
-u "${{ env.REGISTRY_USERNAME }}" \
|
||||
--password-stdin
|
||||
|
||||
- name: Create and push manifest
|
||||
run: |
|
||||
docker manifest create ${{ env.IMAGE_NAME }}:latest \
|
||||
${{ env.IMAGE_NAME }}:amd64 \
|
||||
${{ env.IMAGE_NAME }}:arm64
|
||||
|
||||
docker manifest push ${{ env.IMAGE_NAME }}:latest
|
||||
|
||||
deploy_ivanch_me:
|
||||
name: Deploy Homepage
|
||||
runs-on: ubuntu-amd64
|
||||
needs: build_ivanch_me
|
||||
steps:
|
||||
- name: Recreate Container
|
||||
uses: appleboy/ssh-action@v0.1.7
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script: |
|
||||
cd ${{ secrets.DIR }}
|
||||
docker compose pull
|
||||
docker compose up -d --force-recreate
|
Reference in New Issue
Block a user