Merge pull request #478 from bryxli/dependabot/pip/packages/functions… #135
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: Prod | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Generate release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{secrets.GITHUB_TOKEN}}" | |
prerelease: false | |
automatic_release_tag: latest | |
files: LICENSE | |
deploy: | |
concurrency: | |
group: deploy | |
needs: release | |
environment: prod | |
runs-on: ubuntu-latest | |
env: | |
AWS_REGION: ${{secrets.AWS_REGION}} | |
RIOT_KEY: ${{secrets.RIOT_KEY}} | |
DISCORD_PUBLIC_KEY: ${{secrets.DISCORD_PUBLIC_KEY}} | |
APPLICATION_ID: ${{secrets.APPLICATION_ID}} | |
TOKEN: ${{secrets.TOKEN}} | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/ZoeBotActions | |
role-duration-seconds: 900 | |
aws-region: ${{secrets.AWS_REGION}} | |
- name: Git clone the repository | |
uses: actions/checkout@v4 | |
- name: Create config.json | |
run: | | |
echo "{ \"aws_region\": \"$AWS_REGION\", \"riot_key\": \"$RIOT_KEY\", \"discord_public_key\": \"$DISCORD_PUBLIC_KEY\", \"application_id\": \"$APPLICATION_ID\", \"token\": \"$TOKEN\" }" > configs/config.json | |
- name: Deploy prod app | |
run: | | |
npm ci | |
npm run deploy:prod |