refactor: workflows
This commit is contained in:
parent
e1c2768167
commit
042f538a5a
4 changed files with 37 additions and 79 deletions
37
.github/workflows/gitea-local.yaml
vendored
Normal file
37
.github/workflows/gitea-local.yaml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
name: local-build-dev
|
||||||
|
|
||||||
|
# Intended for local network use.
|
||||||
|
# Remote access is possible if the host has a public IP address.
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
|
||||||
|
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
local-build-dev:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ env.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
config-inline: |
|
||||||
|
[registry."${{ env.REGISTRY }}"]
|
||||||
|
ca=["/etc/ssl/certs/ca-certificates.crt"]
|
||||||
|
- name: Build and Push Docker Image
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64
|
||||||
|
tags: ${{ env.REGISTRY }}/chamomind/jws-backend:latest
|
||||||
|
push: true
|
||||||
31
.github/workflows/local-build-release.yaml
vendored
31
.github/workflows/local-build-release.yaml
vendored
|
|
@ -1,31 +0,0 @@
|
||||||
name: local-build-release
|
|
||||||
|
|
||||||
# Intended for local network use.
|
|
||||||
# Remote access is possible if the host has a public IP address.
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: ${{ vars.DOCKER_REGISTRY }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
local-build-release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Setup Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
config-inline: |
|
|
||||||
[registry."${{ env.REGISTRY }}"]
|
|
||||||
http = true
|
|
||||||
insecure = true
|
|
||||||
- name: Build and Push Docker Image
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: ${{ env.REGISTRY }}/jws/jws-backend:latest
|
|
||||||
allow: security.insecure
|
|
||||||
24
.github/workflows/local-release-demo.yaml
vendored
24
.github/workflows/local-release-demo.yaml
vendored
|
|
@ -1,24 +0,0 @@
|
||||||
name: local-release-demo
|
|
||||||
|
|
||||||
# Intended for local network use.
|
|
||||||
# Remote access is possible if the host has a public IP address.
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
local-release-demo:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Remote deploy internal chamomind server
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.HOST }}
|
|
||||||
username: ${{ secrets.USERNAME }}
|
|
||||||
password: ${{ secrets.PASSWORD }}
|
|
||||||
script: |
|
|
||||||
cd ~/repositories/jws-backend
|
|
||||||
git pull
|
|
||||||
docker compose up -d --build
|
|
||||||
sleep 1
|
|
||||||
docker compose logs -n 100
|
|
||||||
24
.github/workflows/local-release-dev.yaml
vendored
24
.github/workflows/local-release-dev.yaml
vendored
|
|
@ -1,24 +0,0 @@
|
||||||
name: local-release-dev
|
|
||||||
|
|
||||||
# Intended for local network use.
|
|
||||||
# Remote access is possible if the host has a public IP address.
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
local-release-dev:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Remote deploy internal chamomind server
|
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.HOST }}
|
|
||||||
username: ${{ secrets.USERNAME }}
|
|
||||||
password: ${{ secrets.PASSWORD }}
|
|
||||||
script: |
|
|
||||||
cd ~/repositories/jws-backend
|
|
||||||
git pull
|
|
||||||
docker compose up -d --build
|
|
||||||
sleep 1
|
|
||||||
docker compose logs -n 100
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue