ci: deploy stage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user