Second commit #1
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 to TDT4242 server | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| deploy-nginx: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Dotenv Action | |
| uses: falti/dotenv-action@v1.1.4 | |
| with: | |
| export-variables: true | |
| keys-case: bypass | |
| - name: Deploy nginx configuration file | |
| run: | | |
| sudo cp ./nginx/nginx.conf /etc/nginx/conf.d/default.conf | |
| sudo systemctl reload nginx | |
| - name: Show nginx file | |
| run: | | |
| cat /etc/nginx/conf.d/default.conf | |
| sudo nginx -t | |
| sudo systemctl status nginx | |
| echo "Nginx is running correctly" |