diff --git a/.firebaserc b/.firebaserc deleted file mode 100644 index 0ea3a7f0..00000000 --- a/.firebaserc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "projects": { - "default": "danielfrg-com" - } -} diff --git a/.github/workflows/deploy-cf-pages.yml b/.github/workflows/deploy-cf-pages.yml new file mode 100644 index 00000000..0ba61bc9 --- /dev/null +++ b/.github/workflows/deploy-cf-pages.yml @@ -0,0 +1,55 @@ +name: deploy-cf-pages + +on: + workflow_call: + secrets: + CLOUDFLARE_ACCOUNT_ID: + required: true + CLOUDFLARE_TOKEN: + required: true +jobs: + prod: + # if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' + + permissions: + contents: read + id-token: write + pull-requests: write + checks: write + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Restore built website + uses: actions/cache@v4 + with: + path: dist + key: > + website + ${{ github.run_id }} + ${{ github.run_attempt }} + fail-on-cache-miss: true + + - name: Publish to Cloudflare Pages + id: cloudflare-pages-deploy + uses: cloudflare/pages-action@v1.5.0 + with: + apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: jupyter-flex-danielfrg-com + directory: dist + + - name: Comment deploy url + uses: mshick/add-pr-comment@v2 + with: + message-id: cloudflare-deploy + message: | + ### Preview deployment + | Name | Link | + |---------------------------------|------------------------| + | Deploy Preview Url | [${{ steps.cloudflare-pages-deploy.outputs.url }}](${{ steps.cloudflare-pages-deploy.outputs.url }}) | + | Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | + | Latest commit | ${{ github.sha }} | + | Environment | ${{ steps.cloudflare-pages-deploy.outputs.environment }} | diff --git a/.github/workflows/deploy-firebase.yml b/.github/workflows/deploy-firebase.yml deleted file mode 100644 index 156d914a..00000000 --- a/.github/workflows/deploy-firebase.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: deploy-firebase - -on: - workflow_call: - secrets: - GCP_SERVICE_ACCOUNT: - required: true - GCP_WORKLOAD_IDENTITY_PROVIDER: - required: true - -jobs: - prod: - if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' - - permissions: - contents: read - id-token: write - pull-requests: write - checks: write - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Restore built website - uses: actions/cache@v3 - with: - path: dist - key: > - website - ${{ github.run_id }} - ${{ github.run_attempt }} - fail-on-cache-miss: true - - - name: Configure GCP auth - uses: google-github-actions/auth@v1 - id: gcloud-auth - with: - service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} - workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} - create_credentials_file: true - - - name: Set firebase creds - run: | - echo "SERVICE_ACCOUNT_KEY=$(cat "${{ steps.gcloud-auth.outputs.credentials_file_path }}" | tr -d '\n')" >> $GITHUB_ENV - - - uses: FirebaseExtended/action-hosting-deploy@v0 - with: - firebaseServiceAccount: ${{ env.SERVICE_ACCOUNT_KEY }} - repoToken: ${{ secrets.GITHUB_TOKEN }} - channelId: live - # env: - # FIREBASE_CLI_EXPERIMENTS: webframeworks - - preview: - if: (github.event_name == 'pull_request') - - permissions: - contents: read - id-token: write - pull-requests: write - checks: write - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Restore built website - uses: actions/cache@v3 - with: - path: dist - key: > - website - ${{ github.run_id }} - ${{ github.run_attempt }} - fail-on-cache-miss: true - - - name: Configure GCP auth - uses: google-github-actions/auth@v1 - id: gcloud-auth - with: - service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} - workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} - create_credentials_file: true - - - name: Set firebase creds - run: | - echo "SERVICE_ACCOUNT_KEY=$(cat "${{ steps.gcloud-auth.outputs.credentials_file_path }}" | tr -d '\n')" >> $GITHUB_ENV - - - uses: FirebaseExtended/action-hosting-deploy@v0 - with: - firebaseServiceAccount: ${{ env.SERVICE_ACCOUNT_KEY }} - repoToken: ${{ secrets.GITHUB_TOKEN }} - expires: 2d diff --git a/.github/workflows/deploy-cloudflare.yml b/.github/workflows/deploy-post.yml similarity index 96% rename from .github/workflows/deploy-cloudflare.yml rename to .github/workflows/deploy-post.yml index 4243a591..8582807f 100644 --- a/.github/workflows/deploy-cloudflare.yml +++ b/.github/workflows/deploy-post.yml @@ -1,4 +1,4 @@ -name: deploy-cloudflare +name: deploy-post on: workflow_call: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f05e8205..dff0fbcc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,20 +31,20 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: arduino/setup-task@v1 + - uses: actions/checkout@v4 + - uses: arduino/setup-task@v2 # ------------------------------------------------------------------------ # JS - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Load cached node_modules id: cached-node_modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: js/node_modules key: > @@ -67,11 +67,11 @@ jobs: # Python - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cached-python-env with: path: ${{ env.pythonLocation }} @@ -120,7 +120,7 @@ jobs: - name: Cache website id: cache-build - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: dist key: > @@ -128,12 +128,12 @@ jobs: ${{ github.run_id }} ${{ github.run_attempt }} - firebase: - uses: ./.github/workflows/deploy-firebase.yml + cf-pages: + uses: ./.github/workflows/deploy-cf-pages.yml needs: [build] secrets: inherit post-deploy: - uses: ./.github/workflows/deploy-cloudflare.yml - needs: [firebase] + uses: ./.github/workflows/deploy-post.yml + needs: [cf-pages] secrets: inherit diff --git a/firebase.json b/firebase.json deleted file mode 100644 index fd1ef5b3..00000000 --- a/firebase.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "hosting": { - "site": "jupyter-flex", - "public": "dist", - "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] - } -}