hotfix: change how to generate job key #25
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: 'release' | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: create env file | |
working-directory: ./ | |
run: | | |
pwd | |
touch .env | |
echo EVERNOTE_TOKEN=${{ secrets.EVERNOTE_TOKEN }} >> .env | |
echo TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }} >> .env | |
echo TELEGRAM_CHAT_ID=${{ secrets.TELEGRAM_CHAT_ID }} >> .env | |
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env | |
- name: create wrapper script | |
working-directory: ./ | |
run: | | |
pwd | |
touch execute-script.sh | |
echo "#!/bin/bash" >> execute-script.sh | |
echo "sh /home/ubuntu/scripts/sunday-after-install.sh" >> execute-script.sh | |
chmod +x execute-script.sh | |
- name: install dependencies | |
run: pnpm install | |
- name: build server files | |
run: pnpm build | |
# - name: run tests | |
# run: pnpm test | |
- name: zip file | |
run: zip -r sunday.zip ./dist ./package.json ./.env ./appspec.yml ./prisma ./execute-script.sh | |
- name: aws configure credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-northeast-2 | |
- name: upload to s3 | |
run: aws s3 cp --region ap-northeast-2 sunday.zip s3://taehoon-2024-s3 | |
- name: deploy with aws code deploy | |
run: aws deploy create-deployment --application-name sunday --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name group-24 --s3-location bucket=taehoon-2024-s3,key=sunday.zip,bundleType=zip --region ap-northeast-2 |