.github/workflows/publish.yml #281
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
on: | |
push: | |
schedule: | |
# Daily at 8:00 AM Central | |
- cron: 00 13 * * * | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest | |
steps: | |
# Setup | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: "18.x" | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18.1" | |
- uses: hashicorp/setup-terraform@v1 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
terraform_version: 1.0.11 | |
# Build JS | |
- name: js install | |
run: yarn install --frozen-lockfile | |
- name: js test | |
run: yarn run test | |
- name: js build | |
run: yarn run build | |
# Build Go | |
- name: go mod download | |
env: | |
GO111MODULE: "on" | |
run: go mod download | |
- name: go test | |
run: go test ./... | |
- name: go build | |
env: | |
GO111MODULE: "on" | |
run: > | |
go build -o .functions/validate ./functions/validate && | |
go build -o .functions/update ./functions/update && | |
go build -o .functions/reset ./functions/reset && | |
go build -o .functions/read ./functions/read && | |
go build -o .functions/passwd ./functions/passwd && | |
go build -o .functions/create ./functions/create && | |
go build -o .functions/authenticate ./functions/authenticate | |
# Terraform apply | |
- name: terraform fmt | |
run: terraform fmt -check -recursive | |
continue-on-error: true | |
- name: terraform init | |
run: terraform init | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: terraform validate | |
run: terraform validate -no-color | |
- name: terraform apply | |
run: terraform apply -input=false -auto-approve | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# Publish extension | |
- name: extension release | |
run: yarn run release | |
env: | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
EXTENSION_ID: ${{ secrets.EXTENSION_ID }} | |
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | |
WEB_EXT_API_KEY: ${{ secrets.AMO_JWT_ISSUER }} | |
WEB_EXT_API_SECRET: ${{ secrets.AMO_JWT_SECRET }} |