updating pipeline
This commit is contained in:
@@ -2,7 +2,9 @@ name: Homepage Build and Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
workflow_dispatch:
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY_HOST: git.ivanch.me
|
REGISTRY_HOST: git.ivanch.me
|
||||||
@@ -10,46 +12,33 @@ env:
|
|||||||
IMAGE_NAME: ${{ env.REGISTRY_HOST }}/ivanch/mainpage
|
IMAGE_NAME: ${{ env.REGISTRY_HOST }}/ivanch/mainpage
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_ivanch_me:
|
build:
|
||||||
name: Build Homepage Image
|
name: Build Homepage Image
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Log in to Container Registry
|
|
||||||
run: |
|
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" \
|
|
||||||
| docker login "${{ env.REGISTRY_HOST }}" \
|
|
||||||
-u "${{ env.REGISTRY_USERNAME }}" \
|
|
||||||
--password-stdin
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Build and Push Multi-Arch Image
|
- name: Build and Push Multi-Arch Image
|
||||||
uses: docker/build-push-action@v6
|
uses: ivanch/pipeline-actions/build-and-push@main
|
||||||
with:
|
with:
|
||||||
push: true
|
image: ${{ env.IMAGE_NAME }}
|
||||||
context: .
|
registry_password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
platforms: linux/amd64,linux/arm64
|
ssh_key: ${{ secrets.SSH_KEY_DOCKERBUILD }}
|
||||||
tags: |
|
|
||||||
${{ env.IMAGE_NAME }}:latest
|
|
||||||
|
|
||||||
deploy_ivanch_me:
|
deploy:
|
||||||
name: Deploy Homepage
|
name: Deploy Homepage
|
||||||
runs-on: ubuntu-amd64
|
runs-on: ubuntu-amd64
|
||||||
needs: build_ivanch_me
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Recreate Container
|
- name: Recreate Container
|
||||||
uses: appleboy/ssh-action@v0.1.7
|
uses: ivanch/pipeline-actions/ssh-deploy@main
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.HOST }}
|
ssh_host: ${{ secrets.HOST }}
|
||||||
username: ${{ secrets.USERNAME }}
|
ssh_username: ${{ secrets.USERNAME }}
|
||||||
key: ${{ secrets.KEY }}
|
ssh_key: ${{ secrets.KEY }}
|
||||||
port: ${{ secrets.PORT }}
|
ssh_port: ${{ secrets.PORT }}
|
||||||
script: |
|
remote_dir: ${{ secrets.DIR }}
|
||||||
cd ${{ secrets.DIR }}
|
|
||||||
docker compose pull
|
|
||||||
docker compose up -d --force-recreate
|
|
||||||
|
|||||||
Reference in New Issue
Block a user