Add ability to play videos #314
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: Build and deploy | |
on: | |
- push | |
jobs: | |
build-clock: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: pnpm-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
pnpm-${{ runner.os }}- | |
- name: Set up Cypress binary cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/Cypress | |
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
working-directory: ./clock | |
run: pnpm i | |
- name: Lint | |
working-directory: ./clock | |
run: pnpm lint | |
- name: Format | |
working-directory: ./clock | |
run: pnpm format-check | |
- name: Build | |
working-directory: ./clock | |
run: pnpm build | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
working-directory: clock | |
start: npx serve -s build | |
record: ${{ secrets.CYPRESS_RECORD_KEY != '' }} | |
install-command: pnpm i | |
- name: Deploy | |
if: github.ref == 'refs/heads/master' | |
uses: reggionick/s3-deploy@v4 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
with: | |
folder: ./clock/build | |
bucket: ${{ secrets.FRONTEND_BUCKET }} | |
bucket-region: eu-west-1 | |
delete-removed: true | |
private: true | |
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | |
invalidation: index.html | |
- name: Restart all screens | |
if: github.ref == 'refs/heads/master' | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
run: | | |
curl -sL https://firebase.tools | bash | |
for baseKey in vikinni vikuti safamyriuti hasteinsvollur kopavogsvollur; do | |
firebase -P vikes-match-clock-firebase database:set /states/$baseKey/controller/refreshToken -f -d '"'$(uuidgen)'"' --token $FIREBASE_TOKEN | |
done | |
notify: | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
- build-clock | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set error color | |
if: needs.build-clock.result != 'success' | |
run: echo "SLACK_COLOR=#FF0000" >> $GITHUB_ENV | |
- name: Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_USERNAME: Vikes matchclock | |
SLACK_ICON_EMOJI: ":vikes:" | |
SLACK_TITLE: Vikes github actions run | |
SLACK_FOOTER: "Eurovikes" |