diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e710ca2..e872b0e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -51,53 +51,53 @@ jobs: if: (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/WorkflowCI/CDsemanticversioning') && (github.event_name == 'push' || github.event_name == 'pull_request') deploy-to-dev: - name: Deploy to Dev - runs-on: ubuntu-latest - needs: lint-and-test - if: (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/WorkflowCI/CDsemanticversioning') && github.event_name == 'push' - steps: - - uses: actions/checkout@v3 - - name: Install SST - run: | - wget https://github.com/sst/ion/releases/download/v0.0.193/sst-linux-amd64.deb - sudo dpkg -i sst-linux-amd64.deb - sst version - - uses: oven-sh/setup-bun@v1 - - name: Setup AWS Credentials - run: | - mkdir -p ~/.aws - echo "[default]" > ~/.aws/credentials - echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials - echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials - - name: Deploy to AWS with SST - run: | - bun install - sst deploy --stage=dev --verbose - - name: Clean up AWS profile - run: rm -rf ~/.aws + name: Deploy to Dev + runs-on: ubuntu-latest + needs: lint-and-test + if: (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/WorkflowCI/CDsemanticversioning') && github.event_name == 'push' + steps: + - uses: actions/checkout@v3 + - name: Install SST + run: | + wget https://github.com/sst/ion/releases/download/v0.0.193/sst-linux-amd64.deb + sudo dpkg -i sst-linux-amd64.deb + sst version + - uses: oven-sh/setup-bun@v1 + - name: Setup AWS Credentials + run: | + mkdir -p ~/.aws + echo "[default]" > ~/.aws/credentials + echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials + echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials + - name: Deploy to AWS with SST + run: | + bun install + sst deploy --stage=dev --verbose + - name: Clean up AWS profile + run: rm -rf ~/.aws deploy-to-production: - name: Deploy to Production - runs-on: ubuntu-latest - needs: lint-and-test - if: startsWith(github.ref, 'refs/tags/v') - steps: - - uses: actions/checkout@v3 - - name: Install SST - run: | - wget https://github.com/sst/ion/releases/download/v0.0.193/sst-linux-amd64.deb - sudo dpkg -i sst-linux-amd64.deb - sst version - - uses: oven-sh/setup-bun@v1 - - name: Setup AWS Credentials - run: | - mkdir -p ~/.aws - echo "[default]" > ~/.aws/credentials - echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials - echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials - - name: Deploy to AWS with SST - run: | - bun install - sst deploy --stage=production --verbose - - name: Clean up AWS profile - run: rm -rf ~/.aws + name: Deploy to Production + runs-on: ubuntu-latest + needs: lint-and-test + if: startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/checkout@v3 + - name: Install SST + run: | + wget https://github.com/sst/ion/releases/download/v0.0.193/sst-linux-amd64.deb + sudo dpkg -i sst-linux-amd64.deb + sst version + - uses: oven-sh/setup-bun@v1 + - name: Setup AWS Credentials + run: | + mkdir -p ~/.aws + echo "[default]" > ~/.aws/credentials + echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials + echo "aws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials + - name: Deploy to AWS with SST + run: | + bun install + sst deploy --stage=production --verbose + - name: Clean up AWS profile + run: rm -rf ~/.aws