Skip to content

Fix/local name (#60) #80

Fix/local name (#60)

Fix/local name (#60) #80

Workflow file for this run

name: Package publish
on:
push:
tags:
- "*"
env:
AWS_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: https://npm.pkg.github.com/
scope: "@weglot"
- run: npm install
- run: npm run build
- run: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config user.name "github-actions[bot]"
- run: npm version ${GITHUB_REF##*/}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload built flags on staging
uses: jakejarvis/s3-sync-action@master
with:
args: --cache-control 'max-age=1800' --delete --acl public-read --content-type 'image/svg+xml; charset=utf-8'
env:
AWS_S3_BUCKET: cdn-staging.weglot.com
SOURCE_DIR: ./build
DEST_DIR: flags
- name: Upload built flags on production
uses: jakejarvis/s3-sync-action@master
with:
# max age 2592000 (1 month) in production
args: --cache-control 'max-age=2592000' --delete --acl public-read --content-type 'image/svg+xml; charset=utf-8'
env:
AWS_S3_BUCKET: cdn.weglot.com
SOURCE_DIR: ./build
DEST_DIR: flags
- name: Cloudfront invalidations
uses: awact/cloudfront-action@master
env:
SOURCE_PATH: "/flags/*"
DISTRIBUTION_ID: E246SQQF56C0KG