| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,17 @@ | |||
| 1 | 1 | # Simple workflow for deploying static content to GitHub Pages | |
| 2 | 2 | name: Deploy static content to Pages | |
| 3 | 3 | ||
| 4 | + # on: | ||
| 5 | + # # Runs on pushes targeting the default branch | ||
| 6 | + # push: | ||
| 7 | + # branches: ["master"] | ||
| 8 | + # pull_request: | ||
| 9 | + # branches: | ||
| 10 | + # - '*' | ||
| 4 | 11 | on: | |
| 5 | - # Runs on pushes targeting the default branch | ||
| 6 | 12 | push: | |
| 7 | - branches: ["master"] | ||
| 8 | - pull_request: | ||
| 9 | 13 | branches: | |
| 10 | - - '*' | ||
| 14 | + - '**' | ||
| 11 | 15 | ||
| 12 | 16 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| 13 | 17 | ||
@@ -31,7 +35,7 @@ jobs: | |||
| 31 | 35 | - name: Install the dependencies | |
| 32 | 36 | run: npm ci | |
| 33 | 37 | - name: Build | |
| 34 | - run: npm run build | ||
| 38 | + run: npm run build | ||
| 35 | 39 | - name: Upload artifact | |
| 36 | 40 | uses: actions/upload-pages-artifact@v3 | |
| 37 | 41 | with: | |
@@ -51,4 +55,49 @@ jobs: | |||
| 51 | 55 | steps: | |
| 52 | 56 | - name: Deploy to GitHub Pages | |
| 53 | 57 | id: deployment | |
| 54 | - uses: actions/deploy-pages@v4 | ||
| 58 | + uses: actions/deploy-pages@v4 | ||
| 59 | + | ||
| 60 | + deploy-s3: | ||
| 61 | + needs: build | ||
| 62 | + # if: github.ref == 'refs/heads/master' | ||
| 63 | + runs-on: ubuntu-latest | ||
| 64 | + steps: | ||
| 65 | + - name: Checkout | ||
| 66 | + uses: actions/checkout@v4 | ||
| 67 | + | ||
| 68 | + - name: Install s3cmd | ||
| 69 | + run: sudo apt-get update && sudo apt-get install -y s3cmd | ||
| 70 | + | ||
| 71 | + - name: Download build artifact | ||
| 72 | + uses: actions/download-artifact@v4 | ||
| 73 | + with: | ||
| 74 | + name: github-pages | ||
| 75 | + path: build | ||
| 76 | + | ||
| 77 | + - name: Check secret | ||
| 78 | + run: | | ||
| 79 | + if [ -z "${{ secrets.SCW_ACCESS_KEY }}" ]; then | ||
| 80 | + echo "Secret SCW_ACCESS_KEY is not set" | ||
| 81 | + exit 1 | ||
| 82 | + fi | ||
| 83 | + | ||
| 84 | + - name: Create s3cmd config | ||
| 85 | + run: | | ||
| 86 | + echo "[default]" > /home/runner/.s3cfg | ||
| 87 | + echo "access_key = ${{ secrets.SCW_ACCESS_KEY }}" >> /home/runner/.s3cfg | ||
| 88 | + echo "secret_key = ${{ secrets.SCW_SECRET_KEY }}" >> /home/runner/.s3cfg | ||
| 89 | + echo "host_base = s3.fr-par.scw.cloud" >> /home/runner/.s3cfg | ||
| 90 | + echo "host_bucket = %(bucket)s.s3.fr-par.scw.cloud" >> /home/runner/.s3cfg | ||
| 91 | + echo "use_https = True" >> /home/runner/.s3cfg | ||
| 92 | + | ||
| 93 | + - name: Sync build to S3 | ||
| 94 | + run: | | ||
| 95 | + s3cmd sync build/ s3://quantstack-site/ --acl-public \ | ||
| 96 | + --delete-removed --exclude '*.css' --exclude '*.js' --force | ||
| 97 | + s3cmd sync build/ s3://quantstack-site/ --acl-public \ | ||
| 98 | + --mime-type=text/css --exclude '*' --include '*.css' --force | ||
| 99 | + s3cmd sync build/ s3://quantstack-site/ --acl-public \ | ||
| 100 | + --mime-type=application/javascript --exclude '*' --include '*.js' --force | ||
| 101 | + | ||
| 102 | + - name: Ensure public ACL | ||
| 103 | + run: s3cmd setacl s3://quantstack-site/ --acl-public --recursive | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments