build #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: build | |
on: | |
push: {} | |
workflow_dispatch: {} | |
jobs: | |
build: | |
env: | |
PYVER: "3.10" | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ env.PYVER }} | |
- uses: pdm-project/setup-pdm@main | |
with: | |
python-version: ${{ env.PYVER }} | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: pdm sync | |
- name: CLI docs | |
run: | | |
set -ex | |
CLI_DOWNLOAD_URL=$(curl -s https://api.github.com/repos/apppackio/apppack/releases/latest | jq -r '.assets[]|select(.name|contains("Linux_x86_64")).browser_download_url') | |
curl -sLo apppack.tar.gz "$CLI_DOWNLOAD_URL" | |
tar xvzf apppack.tar.gz | |
chmod +x apppack | |
./apppack docgen --directory src/command-line-reference | |
- name: Build | |
run: APPPACK_VERSION=$(./apppack version) make build | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: public | |
retention-days: 3 | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-20.04 | |
if: github.ref == 'refs/heads/deploy/prod' | |
environment: production | |
env: | |
AWS_DEFAULT_REGION: us-east-1 | |
AWS_ROLE_ARN: "arn:aws:iam::101287669015:role/docs-github-actions" | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@master | |
with: | |
role-to-assume: ${{ env.AWS_ROLE_ARN }} | |
aws-region: ${{ env.AWS_DEFAULT_REGION }} | |
- name: Deploy | |
run: mv artifact public && make deploy |