Add .txt to public_key file #10
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: Deploy Script | |
on: | |
push: | |
branches: [main, dev] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Serverless Framework | |
run: npm install -g serverless | |
# public_key.txt and secrets.json both used for api auth guards using Auth0 | |
- name: Create public_key file | |
run: | | |
cat > /home/runner/work/photonranch-projects/photonranch-projects/public_key.txt << EOF | |
-----BEGIN CERTIFICATE----- | |
${{ secrets.AUTH0_PUBLIC_KEY }} | |
-----END CERTIFICATE----- | |
EOF | |
- name: Create Auth0 secrets file | |
run: | | |
cat > /home/runner/work/photonranch-projects/photonranch-projects/secrets.json << EOF | |
{ | |
"AUTH0_CLIENT_ID": "${{ secrets.AUTH0_CLIENT_ID }}" | |
} | |
EOF | |
- name: Install Plugins | |
run: | | |
serverless plugin install --name serverless-python-requirements && \ | |
serverless plugin install --name serverless-domain-manager && \ | |
serverless plugin install --name serverless-dynamodb-pitr | |
# Get the deploy stage from the branch name | |
- name: Set up deployment stage name | |
id: deployment-stage | |
run: | | |
echo "DEPLOY_STAGE=${{ fromJSON('{"main":"prod","dev":"dev"}')[github.ref_name] }}" >> $GITHUB_ENV | |
- name: Serverless Deploy | |
run: serverless deploy --stage $DEPLOY_STAGE | |
env: | |
SERVERLESS_ACCESS_KEY: ${{ secrets.SLS_SECRET_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.SLS_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.SLS_AWS_SECRET_ACCESS_KEY }} |