diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02c3d7b..961390b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: GitHub Pages CI -on: [pull_request, push] +on: [push] + jobs: verify: runs-on: ubuntu-20.04 - if: ${{ github.ref != 'refs/heads/master' }} steps: - name: Checkout uses: actions/checkout@v2 @@ -11,28 +11,3 @@ jobs: run: sudo snap install --edge zola - name: Verify build/links run: zola check - - build_and_deploy: - name: Build site with Zola and deploy - runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' }} - needs: verify - steps: - - uses: actions/checkout@master - - name: Install Zola - run: sudo snap install --edge zola - - name: Build PDF CV - run: | - zola serve & - export ZOLA_PID=$! - sleep 5 - curl localhost:1111/cv &> /dev/null - google-chrome --headless --run-all-compositor-stages-before-draw --print-to-pdf-no-header --print-to-pdf=static/alexlauni-resume.pdf http://localhost:1111/cv - kill $ZOLA_PID - - name: Build site - run: zola build - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b9c8334 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,58 @@ +name: Deploy to Cloudflare Pages +on: [push] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Zola + run: sudo snap install --edge zola + + - name: Build PDF CV + run: | + zola serve & + export ZOLA_PID=$! + sleep 5 + curl localhost:1111/cv &> /dev/null + google-chrome \ + --headless \ + --disable-gpu \ + --run-all-compositor-stages-before-draw \ + --no-pdf-header-footer \ + --print-to-pdf-no-header \ + --print-to-pdf=static/alexlauni-resume.pdf \ + http://localhost:1111/cv + kill $ZOLA_PID + + - name: Print github.ref (debugging) + run: echo ${{ github.ref }} + + - name: Set Build Command for Non-main Branch + if: contains(github.ref, 'refs/heads/') && !endsWith(github.ref, '/main') + env: + GITHUB_REF_NAME: ${{ github.ref_name }} + run: echo "BUILD_COMMAND=zola build -u ${GITHUB_REF_NAME}.lamalex-github-io.pages.dev" >> $GITHUB_ENV + + - name: Set Build Command for Main Branch + if: endsWith(github.ref, '/main') + run: echo "BUILD_COMMAND=zola build" >> $GITHUB_ENV + + - name: Build site + run: ${{ env.BUILD_COMMAND }} + + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: bde07ad246cac0ae6ae68324e6aae341 + projectName: lamalex-github-io + directory: public + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + wranglerVersion: '3' diff --git a/static/CNAME b/static/CNAME deleted file mode 100644 index bb08dc6..0000000 --- a/static/CNAME +++ /dev/null @@ -1 +0,0 @@ -launi.me diff --git a/static/images/scarlet.png b/static/images/scarlet.png deleted file mode 100644 index 923ad0d..0000000 Binary files a/static/images/scarlet.png and /dev/null differ diff --git a/templates/cv-base.html b/templates/cv-base.html index f29b9d2..a695102 100644 --- a/templates/cv-base.html +++ b/templates/cv-base.html @@ -10,7 +10,7 @@