Build 从CircleCI到Github操作使用纱线构建和部署
我正在尝试从CircleCI设置(不是我自己做的)迁移到Github操作,我对文件的语法感到很难理解 这是原始文件Build 从CircleCI到Github操作使用纱线构建和部署,build,web-deployment,yarnpkg,github-actions,circleci,Build,Web Deployment,Yarnpkg,Github Actions,Circleci,我正在尝试从CircleCI设置(不是我自己做的)迁移到Github操作,我对文件的语法感到很难理解 这是原始文件 defaults: &defaults working_directory: ~/repo docker: - image: circleci/node:10.13.0 environment: aws_access_key_id: $ACCESS_KEY aws_secret_access_key: $SECRET_KEY jobs:
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:10.13.0
environment:
aws_access_key_id: $ACCESS_KEY
aws_secret_access_key: $SECRET_KEY
jobs:
install:
<<: *defaults
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- persist_to_workspace:
root: ~/repo
paths: .
test:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Run the tests
command: yarn run test
- persist_to_workspace:
root: ~/repo
paths:
- public
buildBeta:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Build the project
command: REACT_APP_FIREBASE_API_KEY=$FIREBASE_API_KEY REACT_APP_ENV=dev yarn run build
- persist_to_workspace:
root: ~/repo
paths:
- build
buildProd:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Build the project
command: REACT_APP_FIREBASE_API_KEY=$FIREBASE_API_KEY yarn run build
- persist_to_workspace:
root: ~/repo
paths:
- build
deployBeta:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Deploy Beta to AWS
command: |
sudo apt install awscli
AWS_ACCESS_KEY_ID=$ACCESS_KEY AWS_SECRET_ACCESS_KEY=$SECRET_KEY aws s3 sync ./build s3://webappbeta.tipsterchat.com --delete
deployMaster:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Deploy to AWS
command: |
sudo apt install awscli
AWS_ACCESS_KEY_ID=$ACCESS_KEY AWS_SECRET_ACCESS_KEY=$SECRET_KEY aws s3 sync ./build s3://webapp.tipsterchat.com --delete
workflows:
version: 2
-deploy:
jobs:
- install
- buildBeta:
requires:
- install
filters:
branches:
only: develop
- deployBeta:
requires:
- buildBeta
filters:
branches:
only: develop
- buildProd:
requires:
- install
filters:
branches:
only: master
- deployMaster:
requires:
- buildProd
filters:
branches:
only: master
我不知道如何翻译缓存片段,由于某种原因,安装失败
这就是我在安装阶段遇到的错误
name: s3-depl
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Build Beta
run: REACT_APP_FIREBASE_API_KEY=$FIREBASE_API_KEY REACT_APP_ENV=dev yarn build
- name: Deploy app build to S3 bucket
run: aws s3 sync ./build s3://webappbeta.tipsterchat.com --delete