Skip to content

publish

publish #4

Workflow file for this run

name: publish
on:
release:
types: [created]
jobs:
publish-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
registry-url: https://registry.npmjs.org/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: github-action-ecr-deploy
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- run: echo TAGNAME=`echo ${{ github.ref_name }} | sed 's/v//'` >> ${GITHUB_ENV}
- name: Build and push default
uses: docker/build-push-action@v6
with:
provenance: false
push: true
tags: |
opengovsg/lambda-virus-scanner:latest
opengovsg/lambda-virus-scanner:${{ env.TAGNAME }}
public.ecr.aws/f7c3i8y8/opengovsg/lambda-virus-scanner:latest
public.ecr.aws/f7c3i8y8/opengovsg/lambda-virus-scanner:${{ env.TAGNAME }}
- name: Build and push ecs variant
uses: docker/build-push-action@v6
with:
provenance: false
push: true
build-args: |
IS_LAMBDA=false
tags: |
opengovsg/lambda-virus-scanner:latest-ecs
opengovsg/lambda-virus-scanner:${{ env.TAGNAME }}-ecs
public.ecr.aws/f7c3i8y8/opengovsg/lambda-virus-scanner:latest-ecs
public.ecr.aws/f7c3i8y8/opengovsg/lambda-virus-scanner:${{ env.TAGNAME }}-ecs