ci: deploy stage

This commit is contained in:
rezayaghobi-dev
2026-10-21 13:37:31 +03:30
parent 12e72d0418
commit 4c1f6784a1
2 changed files with 61 additions and 0 deletions

View File

@@ -28,3 +28,19 @@ jobs:
run: |
docker run --rm --entrypoint sh rezayaghobi-site:${GITHUB_SHA::7} \
-c 'test -f /usr/share/nginx/html/index.html && test -d /usr/share/nginx/html/assets'
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Deploy
run: |
export TAG=${GITHUB_SHA::7}
docker compose -p portfolio -f deploy/compose.yaml up -d --wait
- name: Smoke test
run: |
curl -fsS http://portfolio:8080/ | grep -qi yaghobi
curl -fsSI http://portfolio:8080/ | grep -qi content-security-policy
test "$(curl -s -o /dev/null -w '%{http_code}' http://portfolio:8080/README.md)" = 404