blog.trnck.dev
at main 62 lines 1.7 kB view raw
1name: Publish to GitHub Pages 2 3# Run when new code is pushed to `main`. Also provide a button for manual deploys. 4on: 5 push: 6 branches: 7 - main 8 workflow_dispatch: 9 10concurrency: 11 group: github_pages 12 cancel-in-progress: true 13 14jobs: 15 build: 16 runs-on: ubuntu-latest 17 permissions: 18 contents: write 19 steps: 20 # Jekyll Picture Tag requires libvips libraries for resizing images, which must be installed 21 - name: Install JPT's dependencies 22 run: sudo apt-get update && sudo apt-get install -y libvips-tools libpng-dev libwebp-dev libjpeg-dev libheif-dev libheif1 23 24 # Put repository source onto the runner so we can build it 25 - name: Checkout 26 uses: actions/checkout@v4 27 28 # Install the proper version of Ruby and run bundle install 29 - name: 💎 Setup Ruby 30 uses: ruby/setup-ruby@v1 31 with: 32 bundler-cache: true 33 cache-version: 2 34 ruby-version: "3.3" 35 36 # Build the site 37 - name: 🧪 Jekyll build 38 run: bundle exec jekyll build 39 env: 40 JEKYLL_ENV: production 41 - name: ⏫ Upload artifact to GitHub Pages 42 id: artifact 43 uses: actions/upload-pages-artifact@v3 44 with: 45 path: _site/ 46 47 deploy: 48 needs: build 49 50 permissions: 51 pages: write # to deploy to Pages 52 id-token: write # to verify the deployment originates from an appropriate source 53 54 environment: 55 name: github-pages 56 url: ${{ steps.deployment.outputs.page_url }} 57 58 runs-on: ubuntu-latest 59 steps: 60 - name: Deploy to GitHub Pages 61 id: deployment 62 uses: actions/deploy-pages@v4