fix:changed env lookup path for docker #12
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: Deploy OpenScope | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to GHCR | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Build image | |
| run: | | |
| docker build -t ghcr.io/${{ github.repository }}/openscope:latest . | |
| - name: Push image | |
| run: | | |
| docker push ghcr.io/${{ github.repository }}/openscope:latest | |
| - name: Deploy to DigitalOcean | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.DEPLOY_HOST }} | |
| username: ${{ secrets.DEPLOY_USER }} | |
| key: ${{ secrets.DEPLOY_KEY }} | |
| script: | | |
| docker pull ghcr.io/${{ github.repository }}/openscope:latest | |
| docker stop openscope || true | |
| docker rm openscope || true | |
| docker run -d \ | |
| --name openscope \ | |
| -p 3000:3000 \ | |
| --env-file /root/openscope/.env.production.local \ | |
| --restart unless-stopped \ | |
| ghcr.io/${{ github.repository }}/openscope:latest |