Add link to device sharing in documentation #100
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 to Production | |
| on: | |
| push: | |
| branches: | |
| - production | |
| # https://github.com/ouzi-dev/commit-status-updater/tree/v2/#workflow-permissions | |
| permissions: | |
| contents: read | |
| statuses: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 21 | |
| - name: Cache npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Set deployment status | |
| uses: ouzi-dev/commit-status-updater@v2 | |
| with: | |
| name: Deploy | |
| status: pending | |
| description: Preparing deploy | |
| - name: Install | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| env: | |
| PUBLIC_GOOGLE_ANALYTICS: ${{ secrets.PRODUCTION_PUBLIC_GOOGLE_ANALYTICS }} | |
| DEPLOYMENT_NAME: 'Production' | |
| - name: Deploy | |
| if: success() | |
| uses: jakejarvis/[email protected] | |
| with: | |
| # delete files not present in SOURCE_DIR, but exclude the static directory | |
| args: --delete --exclude "static/*" --exclude "static" | |
| env: | |
| AWS_S3_BUCKET: ${{ vars.PRODUCTION_BUCKET_NAME }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_SECRET }} | |
| AWS_REGION: ${{ vars.PRODUCTION_REGION }} | |
| SOURCE_DIR: .vitepress/dist | |
| - name: Set success deployment status | |
| if: success() | |
| uses: ouzi-dev/commit-status-updater@v2 | |
| with: | |
| name: Deploy | |
| status: success | |
| description: Deploy ready | |
| url: ${{ vars.PRODUCTION_URL }} | |
| - name: Set failed deployment status | |
| if: failure() | |
| uses: ouzi-dev/commit-status-updater@v2 | |
| with: | |
| name: Deploy | |
| status: failure | |
| description: Failed to deploy | |
| - name: Invalidate CloudFront | |
| uses: chetan/invalidate-cloudfront-action@v2 | |
| env: | |
| DISTRIBUTION: ${{ vars.PRODUCTION_DISTRIBUTION }} | |
| PATHS: "/ /*" | |
| AWS_REGION: ${{ vars.PRODUCTION_REGION }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_KEY }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_SECRET }} |