1.0.156 #156
Workflow file for this run
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
cache-dependency-path: package.json | |
- run: npm ci | |
# puppeteer-screen-recorder installs puppeteer by default, so we need to delete both | |
- run: npm uninstall puppeteer puppeteer-screen-recorder | |
# this will create fresh install in puppeteer-chromium | |
- run: npm install puppeteer | |
- run: chmod -R +x puppeteer-chromium | |
- run: npm install puppeteer-screen-recorder | |
# Moving puppeteer-chromium back to default cache folder | |
- run: npm install -g typescript | |
- run: tsc | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: puppeteer-lambda | |
IMAGE_TAG: puppeteer_lambda | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | |
# - name: Login to ECR | |
# id: ecr | |
# uses: elgohr/ecr-login-action@v3 | |
# with: | |
# access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# region: ${{ secrets.AWS_REGION }} | |
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
# - name: Publish to Registry | |
# uses: elgohr/Publish-Docker-Github-Action@v5 | |
# with: | |
# name: myDocker/repository | |
# username: ${{ steps.ecr.outputs.username }} | |
# password: ${{ steps.ecr.outputs.password }} | |
# registry: ${{ steps.ecr.outputs.registry }} | |
# - run: mkdir ./nodejs | |
# - run: mkdir ./nodejs/node_modules | |
# - run: mkdir ./nodejs/node_modules/puppeteer-lambda | |
# - run: cp ./node_modules ./nodejs/node_modules -r | |
# - run: cp ./package.json ./nodejs/node_modules/puppeteer-lambda/package.json | |
# - run: cp ./dist ./nodejs/node_modules/puppeteer-lambda/dist -r | |
# - run: cp ./index.js ./nodejs/node_modules/puppeteer-lambda/index.js | |
# - name: action-zip | |
# uses: montudor/[email protected] | |
# with: | |
# args: zip -qq -r package.zip nodejs | |
# - uses: hkusu/s3-upload-action@v2 | |
# with: | |
# aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" | |
# aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | |
# aws-region: "${{ secrets.AWS_REGION }}" | |
# aws-bucket: "${{ secrets.AWS_BUCKET }}" | |
# file-path: 'package.zip' | |
# bucket-root: "puppeteer-layer" | |
# destination-dir: "/" | |
# - name: default deploy | |
# uses: appleboy/lambda-action@master | |
# with: | |
# aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# aws_region: ${{ secrets.AWS_REGION }} | |
# s3_bucket: ${{ secrets.AWS_BUCKET }} | |
# function_name: ffprobe | |
# s3_key: "ff-lambda/package.zip" | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
title: "Build" | |
files: | | |
*.zip |