diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy-prod.yml similarity index 62% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy-prod.yml index 516d217f..4fa0a2a9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy-prod.yml @@ -24,10 +24,8 @@ jobs: run: mdbook build - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - personal_token: ${{ secrets.RELEASE_TOKEN }} - publish_branch: gh-pages - publish_dir: ./book - force_orphan: true - cname: 'tech-docs.system76.com' + run: aws s3 sync ./book s3://${{ secrets.PRODUCTION_AWS_S3_BUCKET }}/tech-docs --delete + env: + AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.PRODUCTION_AWS_REGION }} diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 00000000..63250e50 --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -0,0 +1,31 @@ +name: Deploy + +on: + push: + branches: + - staging + +jobs: + Deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + + - name: Install mdBook + env: + MDBOOK_VERSION: 0.5.2 + run: curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=/usr/local/bin + + - name: Build + run: mdbook build + + - name: Deploy + run: aws s3 sync ./book s3://${{ secrets.STAGING_AWS_S3_BUCKET }}/tech-docs --delete + env: + AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.STAGING_AWS_REGION }} diff --git a/book.toml b/book.toml index 06d65937..0f708310 100644 --- a/book.toml +++ b/book.toml @@ -15,6 +15,7 @@ git-repository-url = "https://github.com/system76/tech-docs" git-repository-icon = "fab-github" no-section-label = true sidebar-header-nav = false +site-url = "/tech-docs/" [output.html.fold] enable = true