Skip to content

style: add logo

style: add logo #43

name: Test and Release
on: push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Keep npm cache around to speed up installs
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci --no-audit
- name: Compile TypeScript
run: npx tsc
- name: Run unit tests
run: npm test
- name: Build
env:
PUBLIC_VERSION: ${{ github.sha }}
BASE_URL: /${{ github.event.repository.name }}
run: npm run build
- uses: actions/upload-artifact@v3
if: always()
with:
name: strava-app-${{ github.sha }}
path: build
- name: Publish to GitHub pages
if: github.ref == 'refs/heads/main'
run: |
echo "machine github.com login accesskey password ${{ secrets.GITHUB_TOKEN }}" > ~/.netrc
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git config --global init.defaultBranch gh-pages
cd build
touch .nojekyll
git init
git add -A
git commit -m "update web app"
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git
git push -f origin HEAD:gh-pages
- name: Semantic release
continue-on-error: true
run: npx semantic-release