Skip to content

Commit

Permalink
Add deploy API docs GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
j8r committed Dec 15, 2020
1 parent e0c9995 commit 081f948
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
14 changes: 0 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,6 @@ jobs:
- store_artifacts:
path: ~/test-results/spec

sync_docs_s3:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
echo $CIRCLE_SHA1 > /tmp/workspace/docs/revision.txt
- run: |
docker run -v /tmp/workspace/docs:/docs \
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
mesosphere/aws-cli \
s3 sync /docs/ s3://crystal-api/api/master --delete
prepare_common:
docker:
- image: docker:stable-git
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,34 @@ jobs:

- name: Check Format
run: bin/ci format

deploy_api_docs:
env:
ARCH: x86_64
ARCH_CMD: linux64
runs-on: ubuntu-latest
steps:
- name: Download Crystal source
uses: actions/checkout@v2

- name: Prepare System
run: bin/ci prepare_system

- name: Prepare Build
run: bin/ci prepare_build

- name: Build docs
run: bin/ci with_build_env 'make crystal docs threads=1'

- name: Configure AWS Credentials
if: github.repository_owner == 'crystal-lang' && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Deploy API docs to S3
if: github.repository_owner == 'crystal-lang' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
aws s3 sync ./docs s3://crystal-api/api/master --delete

0 comments on commit 081f948

Please sign in to comment.