Skip to content

Deploy to github pages example #154

@acrogenesis

Description

@acrogenesis

I enjoyed creating my website with tableau, it's very straightforward and ai (codex) didn't have any issues at all.
I wanted to contribute with this small deploy script for github actions but wasn't sure where to add it.

https://github.com/acrogenesis/acrogenesis.com/blob/main/.github/workflows/deploy.yml

name: Deploy site to GitHub Pages

on:
  push:
    branches: [main]

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: pages
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Set up Erlang/OTP and Elixir
        uses: erlef/setup-beam@v1
        with:
          otp-version: "28"
          elixir-version: "1.18"

      - name: Cache Mix deps
        uses: actions/cache@v4
        with:
          path: |
            ~/.mix
            deps
            _build
          key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
          restore-keys: |
            ${{ runner.os }}-mix-

      - name: Install dependencies
        run: MIX_ENV=prod mix deps.get --only prod

      - name: Build site
        run: MIX_ENV=prod mix build

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v4
        with:
          path: _site

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - id: deployment
        uses: actions/deploy-pages@v4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions