Ongoing fixes #3
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
name: javascript state quickstart | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/state_javascript.yaml | |
- state/javascript/* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
environment: shared-production | |
# Only run on main repo (not on forks) | |
if: github.repository_owner == 'diagridio' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
- name: build local | |
run: | | |
cd state/javascript | |
npm install | |
- name: build publisher image | |
run: | | |
cd state/javascript/publisher | |
docker buildx build --platform linux/amd64 -t state-javascript . | |
- name: Configure AWS credentials | |
if: github.event_name != 'pull_request' | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ vars.AWS_CI_ROLE }} | |
aws-region: ${{ vars.AWS_CI_REGION }} | |
- name: Login to Amazon ECR | |
if: github.event_name != 'pull_request' | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
registry-type: public | |
- name: push order-app image | |
if: github.event_name != 'pull_request' | |
env: | |
PUBLIC_ECR: "${{ steps.login-ecr.outputs.registry }}/${{ vars.AWS_PUBLIC_ECR_ALIAS }}/state-javascript" | |
run: | | |
docker tag state-javascript:latest $PUBLIC_ECR:latest | |
docker push $PUBLIC_ECR:latest |