diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 12536da..555f515 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,24 +1,58 @@ name: deployment on: + # Runs on pushes targeting the default branch push: - branches: - - master + branches: [$default-branch] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + id-token: write + pages: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress +# and latest queued. However, do NOT cancel in-progress runs as we want to allow +# these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false jobs: - github-pages: + # Build job + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 0 # Increment this number if you need to re-download cached gems + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + with: + enablement: true + - name: Build with Jekyll + env: + JEKYLL_ENV: production + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 - - uses: helaili/jekyll-action@2.0.3 - env: - JEKYLL_ENV: production - JEKYLL_PAT: ${{ secrets.JEKYLL_PAT }} + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2