CD debug #20
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: Deployment to dev.osmgo.com | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
deployment: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint code style | |
run: npm run prettier:check | |
- name: Run tests | |
run: npm run test:ci | |
- name: Create build | |
run: npm run build | |
# add delay to wait for the build to finish | |
- name: Wait for build to finish | |
run: sleep 10 | |
- name: List files to be deployed | |
run: ls ./www | |
- name: Check for index.html | |
run: | | |
if [ ! -f www/index.html ]; then | |
echo "index.html is missing!" | |
exit 1 | |
fi | |
- name: Deploy to S3 | |
uses: jakejarvis/s3-sync-action@master | |
env: | |
AWS_S3_ENDPOINT: ${{ secrets.STORJ_ENDPOINT }} | |
AWS_S3_BUCKET: osmgo-dev | |
AWS_ACCESS_KEY_ID: ${{ secrets.STORJ_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.STORJ_SECRET_KEY }} | |
SOURCE_DIR: 'www' | |
with: | |
args: --acl public-read --follow-symlinks --delete --include "*" --debug |