testing workflow #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Nginx Configuration | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'nginx_securefit.conf' | |
| - '.github/workflows/nginx-deploy.yml' | |
| jobs: | |
| deploy-nginx: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Configure Git | |
| run: | | |
| git config --global url."https://oauth2:${GITLAB_TOKEN}@git.ntnu.no".insteadOf "https://git.ntnu.no" | |
| env: | |
| GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Deploy nginx configuration | |
| run: | | |
| sudo cp -v ./nginx_securefit.conf /etc/nginx/conf.d/nginx_securefit.conf | |
| sudo nginx -t | |
| sudo systemctl reload nginx | |
| - name: Verify nginx configuration | |
| run: | | |
| sleep 5 # Give nginx time to reload | |
| curl -I http://tdt4242-26.idi.ntnu.no || true # Use the actual server name | |
| sudo systemctl status nginx |