Merge pull request #50 from rajat-ws/feat/add-lingui #50
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: React GraphQL TypeScript Template CD | |
on: | |
push: | |
branches: [master] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn | |
- name: Build | |
run: yarn build:prod | |
- name: Deploy to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
SOURCE_DIR: './build/' | |
- name: Set branch name | |
id: vars | |
run: echo ::set-output name=stage::${GITHUB_REF#refs/*/} | |
- name: Create badges | |
run: yarn run test:badges | |
- name: Commit badges | |
uses: EndBug/add-and-commit@v7 | |
with: | |
author_name: Gitflow | |
author_email: git@wednesday.is | |
message: 'Update badges' | |
add: 'badges/' | |
push: false | |
- name: Git pull origin | |
run: | | |
git pull origin ${{ github.ref }} | |
- name: Pushing to a protected branch | |
uses: CasperWA/push-protected@v2 | |
with: | |
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }} | |
branch: ${{ steps.vars.outputs.stage }} | |
unprotect_reviews: true |