-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.33 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# ----------------------------------------------------------------------------------------------------------
#
# This is the production continuous integration build github action.
# Activates on any commit to the main branch.
#
# ----------------------------------------------------------------------------------------------------------
name:
Wordpress protected assets deploy to prod
on:
push:
branches:
- main
env:
AWS_REGION: us-east-1
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
# Setup the container, build and deploy the app
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: aws-actions/setup-sam@v2
- uses: actions/[email protected]
with:
node-version: '18'
- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::115619461932:role/WordpressProtectedAssetsGithubActionsCloudformingRole
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}
- run: npm ci
- run: npm test
- run: sam build --config-env prod --use-container
- run: sam deploy --config-env prod