✨ Add web service to Docker setup and integrate with Cloudflare Tunnel #23
This file contains hidden or 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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| jobs: | |
| run: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| fetch-depth: 0 | |
| - name: Download credentials | |
| run: | | |
| cat <<EOF > .env | |
| ${{ secrets.ENV_FILE }} | |
| EOF | |
| mkdir -p cloudflared | |
| cat <<EOF > cloudflared/credentials.json | |
| ${{ secrets.CREDENTIALS_JSON }} | |
| EOF | |
| - name: Stop previous instance | |
| run: | | |
| ./stop.sh | |
| - name: Start instance | |
| run: | | |
| ./start.sh | |
| - name: Clean up old images | |
| run: docker image prune -f |