diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ed68ee2 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Build and Deploy to S3 + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '20' + cache: 'yarn' + + - name: Get modules + run: yarn install + + - name: Build + run: yarn build + + - name: Set up AWS CLI + uses: aws-actions/setup-cli@v1 + + - name: Configure AWS CLI for S3-compatible endpoint + run: | + aws configure set aws_access_key_id ${{ secrets.S3_ACCESS_KEY_ID }} + aws configure set aws_secret_access_key ${{ secrets.S3_SECRET_ACCESS_KEY }} + aws configure set default.region ${{ secrets.S3_REGION }} + aws configure set default.s3.endpoint_url ${{ secrets.S3_ENDPOINT_URL }} + + - name: Deploy to Scaleway + run: | + aws s3 sync ./public s3://stock-options --endpoint-url ${{ secrets.S3_ENDPOINT_URL }} \ No newline at end of file