Update .github/workflows/deploy.yml
All checks were successful
Deploy App / build (push) Successful in 1m40s
Deploy App / deploy (push) Successful in 15s

This commit is contained in:
2025-10-22 21:22:03 +00:00
parent 298a7645e3
commit a9e06c95df

View File

@@ -2,14 +2,14 @@ name: Deploy App
on: [push] on: [push]
jobs: jobs:
deploy: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: container:
volumes: volumes:
- /var/docker-web:/var/docker-web - /var/docker-web:/var/docker-web
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Deploy with docker-web - name: Prepare and build app
run: | run: |
REPO_NAME="${GITHUB_REPOSITORY##*/}" REPO_NAME="${GITHUB_REPOSITORY##*/}"
APP_DIR="/var/docker-web/apps/${REPO_NAME}" APP_DIR="/var/docker-web/apps/${REPO_NAME}"
@@ -19,4 +19,17 @@ jobs:
cp -a $(find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name 'node_modules') "$APP_DIR/" cp -a $(find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name 'node_modules') "$APP_DIR/"
export COMPOSE_BAKE=false export COMPOSE_BAKE=false
docker rmi "local/${REPO_NAME}" 2>/dev/null || true docker rmi "local/${REPO_NAME}" 2>/dev/null || true
bash /var/docker-web/src/cli.sh up "${REPO_NAME}" bash /var/docker-web/src/cli.sh build "${REPO_NAME}"
deploy:
runs-on: ubuntu-22.04
needs: build
container:
volumes:
- /var/docker-web:/var/docker-web
steps:
- uses: actions/checkout@v4
- name: Deploy with docker-web
run: |
REPO_NAME="${GITHUB_REPOSITORY##*/}"
bash /var/docker-web/src/cli.sh up "${REPO_NAME}"