Merge pull request #244 from LandsOfHope/develop #285
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: Deploy | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: install gitversion | |
uses: gittools/actions/gitversion/setup@v0 | |
with: | |
versionSpec: "5.x" | |
- name: determine version | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v0 | |
with: | |
useConfigFile: true | |
- name: Set package.json version | |
run: npm version --no-git-tag-version "${{steps.gitversion.outputs.fullSemVer}}" | |
- name: npm ci | |
working-directory: .scripts | |
run: npm ci | |
- name: generate_all_json | |
run: node .scripts/generate_all_json | |
- name: generate_id_schemas | |
run: node .scripts/generate_id_schemas | |
- name: validate schemas | |
run: node .scripts/validate | |
- name: compile schemas | |
run: node .scripts/compile_schemas.js | |
- name: generate typescript api types | |
run: docker run --rm -v $PWD/schemas:/schemas -v $PWD/api:/api -v $PWD/.scripts/generate_api_ts.sh:/generate_api_ts.sh node sh generate_api_ts.sh | |
- name: generate health file | |
run: node .scripts/generate_health.js | |
- run: pip install s3cmd | |
- name: Publish | |
run: s3cmd sync --no-mime-magic --guess-mime-type --access_key=${{ secrets.AWS_ACCESS_KEY_ID }} --secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY }} --host=${{ secrets.AWS_ENDPOINT_URL }} --host-bucket=${{ secrets.AWS_ENDPOINT_URL }} --bucket-location=auto --delete-removed --delete-after --no-preserve --recursive --rexclude "^\..*$" . 's3://lohdata' | |
# run: aws s3 sync . s3://lohdata --endpoint-url ${{ secrets.AWS_ENDPOINT_URL }} --delete --exclude ".*" --exclude "*/.*" | |
if: ${{ github.ref == 'refs/heads/master' }} | |
# env: | |
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# AWS_DEFAULT_REGION: "auto" |